From 11a191f3981a5801be9fabbbc664fc5e7fffecd4 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Tue, 12 Jul 2011 13:27:05 -0400 Subject: [PATCH] Add support for SunOS Tested on OpenIndiana 0.151 Signed-off-by: Josef 'Jeff' Sipek --- os.SunOS | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 os.SunOS diff --git a/os.SunOS b/os.SunOS new file mode 100644 index 0000000..30b9cb0 --- /dev/null +++ b/os.SunOS @@ -0,0 +1,52 @@ +# usage: touch_date +touch_date() +{ + touch -d @$1 "$2" +} + +# usage: last_modified +last_modified() +{ + stat -c "%Y" "$1" +} + +# usage: format_last_modified +format_last_modified() +{ + # must strip nano-second part otherwise git gets very + # confused, and makes up strange timestamps from the past + # (chances are it decides to interpret it as a unix + # timestamp). + stat -c "%y" "$1" | sed -e ' +s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)\.[0-9]* \(.*\)$/\1-\2-\3 \4:\5:\6 \7/' +} + +# usage: head_n [count] +head_n() +{ + head -n "$1" +} + +# usage: sha1 [file] +sha1() +{ + sha1sum "$1" +} + +# usage: cp_a +cp_a() +{ + cp -a "$1" "$2" +} + +# usage: _tac +_tac() +{ + tac +} + +_seq() +{ + seq "$@" + return $? +} -- 2.11.4.GIT