monfold.sh: Use $(...) instead of `...` for command substitution
authorW. Trevor King <wking@tremily.us>
Sat, 21 Sep 2013 17:31:14 +0000 (10:31 -0700)
committerW. Trevor King <wking@tremily.us>
Sat, 21 Sep 2013 17:41:47 +0000 (10:41 -0700)
It's nestable [1], and it just looks nicer.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03

posts/inotify/monfold.sh

index 14ba57ec4e62f3e81d5a1a5656d2a4483651ac53..7c92706aebb6e649b01e3b21c7e9ec0584741bb0 100755 (executable)
@@ -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"