Commits

Cameron Simpson  committed 58dbb7a

run-analog: fix file grabber, fix -d option, activate tail end analog invocation

  • Participants
  • Parent commits 55d5366

Comments (0)

Files changed (1)

File bin/run-analog

 cmd=`basename "$0"`
 usage="Usage: $cmd -d reportdir template-analog-config SETTING=value... {/path/to/logfile|/path/to/logdir}..."
 
-trace=eecho     ##set-x
+trace=set-x
 reportdir=
 
 badopts=
 while [ $# -gt 0 ]
 do
   case "$1" in
-    -d) reportdir=$1; shift ;;
+    -d) reportdir=$2; shift ;;
     --) shift; break ;;
     -?*)echo "$cmd: unrecognised option: $1" >&2; badopts=1 ;;
     *)  break ;;
 patchfile=$tmppfx-patch
 >>"$patchfile"
 
+# gather up special settings
 while [ $# -gt 0 ]
 do
   case "$1" in
   shift
 done
 
+# gather up logfiles or directories
 while [ $# -gt 0 ]
 do
   case "$1" in
       path=$1
       if [ -d "$path/." ]
       then find "$path/." -type f -exec printf 'LOGFILE "%s"\n' {} ';' >>"$patchfile"
-      else printf 'LOGFILE "%s\n"' >>"$patchfile"
+      else printf 'LOGFILE "%s"\n' "$path" >>"$patchfile"
       fi
       ;;
     *)break ;;