From 19be922cb97c88a6dfe3caa8f33db32338572302 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 31 Jan 2016 10:31:29 +1100 Subject: [PATCH] Added birthday support to BSD --- 1.1.md | 2 +- fetch | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/1.1.md b/1.1.md index fecaa181..d5cf589b 100644 --- a/1.1.md +++ b/1.1.md @@ -59,7 +59,7 @@ systems it isn't packaged for yet! **Birthday:** -- Added `birthday` which prints the age of tyour OS +- Added `birthday` which prints the age of your OS - Added `--birthday_shorthand` and `$birthday_shorthand` to shorten/lengthen
the output of birthday. - Added `--birthday_time` and `$birthday_time` to show/hide the time in the output. diff --git a/fetch b/fetch index c1fb12da..a5b79275 100755 --- a/fetch +++ b/fetch @@ -1197,7 +1197,12 @@ getbirthday () { ;; "Mac OS X") - birthday="$(ls -alctT /var/log/CDIS.custom | tail -1 | awk '{printf $6 " " $7 " " $9 " " $8}')" + birthday="$(ls -alctT /var/log/CDIS.custom | awk '{printf $6 " " $7 " " $9 " " $8}')" + date_cmd="$(date -j -f "%b %d %Y" "$birthday" "+%a %d %b %Y %l:%M %p")" + ;; + + *"BSD") + birthday="$(ls -alctT /etc/hostid | awk '{printf $6 " " $7 " " $9 " " $8}')" date_cmd="$(date -j -f "%b %d %Y" "$birthday" "+%a %d %b %Y %l:%M %p")" ;;