From: W. Trevor King Date: Sat, 21 Sep 2013 17:24:34 +0000 (-0700) Subject: monfold.sh: Use tabs instead of mixed tabs/spaces for indentation X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3772bc6946aacaee19b87e3ce67a156cf575e6c9;p=blog.git monfold.sh: Use tabs instead of mixed tabs/spaces for indentation Then folks can set the tab width to whatever they want and still get indentation that makes sense. --- diff --git a/posts/inotify/monfold.sh b/posts/inotify/monfold.sh index 33d1035..14ba57e 100755 --- a/posts/inotify/monfold.sh +++ b/posts/inotify/monfold.sh @@ -17,8 +17,8 @@ # grabbing the upper window. if [ $# -ne 1 ]; then - echo "usage: monfold " - exit 1 + echo "usage: monfold " + exit 1 fi DATADIR="$1" @@ -57,24 +57,24 @@ 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}'` - if [ "$EVENT" != "CLOSE_WRITE,CLOSE" ]; then - echo "Error (unexpected event '$EVENT'):" - echo "$LINE" - exit 1 - fi - if [ "$FILE" != "$LASTFILE" ] && [ "$LASTFILE" != "" ]; then - # We must have finished writing to $LASTFILE... - echo "process $DIR$LASTFILE -> $OUTFILE" - ln -s "$DIR$LASTFILE" "$DATALINK" - gnuplot "$GPFILE" - rm "$DATALINK" - echo $ACTION - $ACTION - fi - LASTFILE="$FILE" + 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" + exit 1 + fi + if [ "$FILE" != "$LASTFILE" ] && [ "$LASTFILE" != "" ]; then + # We must have finished writing to $LASTFILE... + echo "process $DIR$LASTFILE -> $OUTFILE" + ln -s "$DIR$LASTFILE" "$DATALINK" + gnuplot "$GPFILE" + rm "$DATALINK" + echo $ACTION + $ACTION + fi + LASTFILE="$FILE" done < <(inotifywait -q -m -e CLOSE_WRITE --exclude '.*unfold_.*' "$DATADIR") rm "$GPFILE"