echo command always prints its arguments

Peter Klosky peter at rlgvax.UUCP
Mon Apr 22 11:49:56 AEST 1985


trmsg(na)
+++ Using echo to put data on the file system can be tricky.
+++ The following script would truncate it's file regularly due to
+++ the window between the shell performing
+++ the i/o redirection and the echo program being invoked, given 
+++ a signal in the window.

if test -f .jobname
 then
     lastjob=`cat .jobname`
else
     lastjob=0
fi
thisjob=`expr $lastjob + 1`
echo $thisjob >.jobname



More information about the Comp.unix mailing list