[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: scripting help



On 07-Aug-98 Patrick Olson wrote:
> My script doesn't quite work.  Could someone tell me what I've done wrong?
> 
> The problem is that it displays the file as soon as it has a nonzero
> length. I would like the script to wait until the file is 95 bytes long.
> 
> My script:
> 
> -----
> until test -s filename
> do
>       sleep 5s
> done
> 
> cat filename

This may not be the neatest way to do it but it is straightforward and it
should work (by the way, "[ expr ]" means the same as "test expr"):

  until [ $( cat filename | wc -c ) -ge 95 ]
  do
        sleep 5s
  done

  cat filename

Hope this helps (and hope it works!)

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk>
Date: 08-Aug-98                                       Time: 00:11:14
--------------------------------------------------------------------


--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: