aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2020-06-19 10:05:10 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2020-06-19 10:06:24 +0800
commitd4b6b59283e2d0354e559280505647556d25106b (patch)
treef582580c7368993a9fac39bbbd6a869b22a4f032
parent495883372a64744e6cf0ac98c4eb5ccd57ce87fb (diff)
Simplify tac
-rwxr-xr-xgist8
1 files changed, 1 insertions, 7 deletions
diff --git a/gist b/gist
index 685a127..73e7018 100755
--- a/gist
+++ b/gist
@@ -91,13 +91,7 @@ tmp_file() {
91 mktemp -p $tmp_dir -t $1.XXXXXX 91 mktemp -p $tmp_dir -t $1.XXXXXX
92 fi 92 fi
93} 93}
94tac() { 94tac() { sed -e '1! G; h; $!d' $1; } # An easy way to reverse file content both on Linux and Darwin
95 if [[ $(uname) == Darwin ]]; then
96 tail -r $1
97 else
98 $(which tac) $1
99 fi
100}
101mtime() { 95mtime() {
102 if [[ $(uname) == Darwin ]]; then 96 if [[ $(uname) == Darwin ]]; then
103 stat -x $1 | grep Modify | cut -d' ' -f2- 97 stat -x $1 | grep Modify | cut -d' ' -f2-