From 3772bc6946aacaee19b87e3ce67a156cf575e6c9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Sep 2013 10:24:34 -0700 Subject: [PATCH] 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. --- posts/inotify/monfold.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) 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" -- 2.26.2