From: W. Trevor King Date: Sat, 21 Sep 2013 17:31:14 +0000 (-0700) Subject: monfold.sh: Use $(...) instead of `...` for command substitution X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=df4680e756be9a6aa046f1c49bedcbda2a9122f5;p=blog.git monfold.sh: Use $(...) instead of `...` for command substitution It's nestable [1], and it just looks nicer. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03 --- diff --git a/posts/inotify/monfold.sh b/posts/inotify/monfold.sh index 14ba57e..7c92706 100755 --- a/posts/inotify/monfold.sh +++ b/posts/inotify/monfold.sh @@ -57,9 +57,9 @@ EOF LASTFILE="" # Multiple close events for the same file as data is written in blocks while read LINE; do - DIR=`echo "$LINE" | awk '{print $1}'` # has trailing slash - EVENT=`echo "$LINE" | awk '{print $2}'` - FILE=`echo "$LINE" | awk '{print $3}'` + DIR=$(echo "$LINE" | awk '{print $1}') # has trailing slash + EVENT=$(echo "$LINE" | awk '{print $2}') + FILE=$(echo "$LINE" | awk '{print $3}') if [ "$EVENT" != "CLOSE_WRITE,CLOSE" ]; then echo "Error (unexpected event '$EVENT'):" echo "$LINE"