1 # usage: touch_date <unix ts> <file>
7 # usage: last_modified <file>
13 # usage: format_last_modified <file>
14 format_last_modified()
16 # must strip nano-second part otherwise git gets very
17 # confused, and makes up strange timestamps from the past
18 # (chances are it decides to interpret it as a unix
20 stat -c "%y" "$1" | sed -e '
21 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/'
24 # usage: head_n [count]
36 # usage: cp_a <src> <dst>