Re: scripting help
Your script worked great.
Thanks,
Patrick
On Fri, 7 Aug 1998, Lee Brinton wrote:
> On Thu, Aug 06, 1998 at 08:11:36PM -0700, 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
> > -----
> >
> Try this:
> MAX=10
> ITER=0
>
> BYTES=`wc --bytes filename | awk -- '{print $1}'`
> while test $BYTES -lt 95 -a $ITER -lt $MAX
> do
> sleep 5s
> let ITER=ITER+1
> BYTES=`wc --bytes filename | awk -- {print $1}'`
> done
>
> cat filename
> --
--
Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
Reply to: