root/bin/mtime @ 7272
1 | 6968 | aaronmk | #!/bin/sh
|
---|---|---|---|
2 | # Gets the modification time of a file
|
||
3 | |||
4 | if ! test "$#" -eq 1; then |
||
5 | echo "Usage: self file"|fold -s >&2 |
||
6 | exit 2
|
||
7 | fi
|
||
8 | |||
9 | dateFmt='%-Y-%-m-%-d %-H:%M:%S %Z' |
||
10 | |||
11 | if test "$(uname)" = Darwin; then stat -f %Sm -t "$dateFmt" "$1" |
||
12 | else date --reference="$1" +"$dateFmt" |
||
13 | fi
|