On Sun, 2002-12-08 at 15:38, Rob Lahaye wrote:
> Darren Freeman wrote:
> > 
> > Aaah crap, my /bin/sh is a symlink to bash =) No wonder =)
> > 
> > OK so reading the above, what's the sh way of doing these things? Since
> > I don't even have sh it explains why I don't have the manpage...
> 
> What funny OS are you using?

Mandrake Linux 9.0 =)

> Instead of "you writing semi-sh script and having me testing it for you",
> I suggest you install the real "sh" on your OS and write & test the script
> yourself :) Wouldn't that be more sensible?

it might but I was hoping it wouldn't take long to fix those two
things.. and up until now I thought I was using sh.. Mandrake tricked me
into thinking I had compatibility =(

> Instead of the C-style for loop, you could do something like:
> 
> count="0" # or whatever start value.
> while ( "$count" != "$someMaxValue" )
> do
>       #
>       # Do your thing here
>       #
>       count=`expr $count + 1`
> done

I just did a

while (( --count > 0 ))
do
   ...
done

Is that valid?

> I'm not sure, but something like this should work.
> Although a more experienced script writer may have a much
> better solution....

Yeah if only.. if only.. at least I'm slowly becoming a more experienced
script writer (at everybody else's expense =)

> Regards,
> Rob.

Darren

Reply via email to