monfold.sh: Use here-documents to write GPFILE
authorW. Trevor King <wking@tremily.us>
Sat, 21 Sep 2013 17:18:15 +0000 (10:18 -0700)
committerW. Trevor King <wking@tremily.us>
Sat, 21 Sep 2013 17:41:46 +0000 (10:41 -0700)
Instead of wasting a call to echo.  Here-documents are in POSIX [1].

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

posts/inotify/monfold.sh

index 934460196fb0f6cb4d38e5bf0f29c326334e6b85..33d10356a477128508c918536324b0df6f27376e 100755 (executable)
@@ -27,9 +27,11 @@ DATALINK="./monfold.data"
 OUTFILE="./monfold.png"
 ACTION="scp $OUTFILE einstein:./public_html/rsrch/monfold.png" # upload to web
 
-echo "set terminal png
+cat > "$GPFILE" <<EOF
+set terminal png
 set output '$OUTFILE'
-plot '$DATALINK' using ((\$1/2**15-1)*10):((\$2/2**15-1)*10)" > "$GPFILE"
+plot '$DATALINK' using ((\$1/2**15-1)*10):((\$2/2**15-1)*10)"
+EOF
 
 # The way output from the unfolding software works, we get a bunch of
 #   YYYYMMDDHHMMSS_unfold