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

Re: bash syntax



On Tue, 25 Nov 1997, Stephen Zander wrote:

> "Eloy A. Paris" wrote:
> > Witold Grabysz <vtold@polsl.gliwice.pl> wrote:
> > 
> > : the following phrase doesn't work in bash:
> > : ((ls);(ls))
> > : Why? Is it not allowed by the shell syntax or there is a bug in it?
> > 
> > Yup, you're right; it's probably a bug. This does work:
> > 
> > ( (ls);(ls))
> > 
> > Try changing the definition of the helper in Netscape to follow the
> > above syntax.
> 
> No, there's no bug in bash. ((<expr>)) indicates that arithmetic operations
> should be performed a la let x=i+1.  Try this
> 
> 	let i=5; while ((i>0)); echo $i; let i-=1; done
> 
> The fix is right how ever; you need to disambiguate the expression.

You missed out the "do":

        let i=5; while ((i>0)); do echo $i; let i-=1; done

...RickM...



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: