Re: Looping in ksh

2006-12-20 Thread Paul de Weerd
On Wed, Dec 20, 2006 at 08:17:04PM +0800, Uwe Dippel wrote: | Otto Moerbeek wrote: | | >(( .. )) is ksh specific. | | I know. | | > Put #!/bin/ksh in your scritp and you'll be fine. | | Have you tried it ? I did. It doesn't work. It works. How are you running this test ? [EMAIL PROTECTED] $ cat >

Re: Looping in ksh

2006-12-20 Thread Otto Moerbeek
On Wed, 20 Dec 2006, Uwe Dippel wrote: > Otto Moerbeek wrote: > > > (( .. )) is ksh specific. > > I know. > > > Put #!/bin/ksh in your scritp and you'll be fine. > > Have you tried it ? I did. It doesn't work. Here it works. You must be doing something wrong. -Otto

Re: Looping in ksh

2006-12-20 Thread Uwe Dippel
L. Ahmadi wrote: If you want to use /bin/sh, No I don't (and didn't). But now I know my mistake: I had put #!/bin/ksh for a good reason, but I did call it with $ sh progname That's rather me stupid, then ! Thanks everyone for answering, Uwe

Re: Looping in ksh

2006-12-20 Thread Uwe Dippel
Otto Moerbeek wrote: (( .. )) is ksh specific. I know. > Put #!/bin/ksh in your scritp and you'll be fine. Have you tried it ? I did. It doesn't work. Uwe

Re: Looping in ksh

2006-12-20 Thread Bruno Carnazzi
2006/12/20, Uwe Dippel <[EMAIL PROTECTED]>: I needed some little script; and - as usual - tried it out by typing: i=0 uplim=10 while [ $i -lt $uplim ] do ((i=i+1)) echo $i done 1 2 3 4 5 6 7 8 9 10 Hi, This is a shell rewrite of jot(1). Try : $ jot 10 1 10 Best Regard, Bruno.

Re: Looping in ksh

2006-12-20 Thread Michael
L. Ahmadi schrieb: > Hi, > > If you want to use /bin/sh, it works well if you replace > > ((i=i+1)) by > let i=i+1 Or use I=$((I+1)) which works in sh/ksh/bash and should be pretty universal. - Michael

Re: Looping in ksh

2006-12-20 Thread L. Ahmadi
Hi, If you want to use /bin/sh, it works well if you replace ((i=i+1)) by let i=i+1 L. Ahmadi Uwe Dippel wrote: I needed some little script; and - as usual - tried it out by typing: i=0 uplim=10 while [ $i -lt $uplim ] do ((i=i+1)) echo $i done 1 2 3 4 5 6 7 8 9 10 So good, so

Re: Looping in ksh

2006-12-20 Thread Kevin Foo
On Wednesday 20 December 2006 18:43, Uwe Dippel wrote: > i=0 > uplim=10 > while [ $i -lt $uplim ] > do >((i=i+1)) >echo $i > done #!/bin/ksh -- Warm regards, Kevin Foo Key fingerprint : 4B23 FC1C E50B 9693 CCDD 2A7D A048 E909 8924 9BDD Public key : http://keyserver.linux.it/pks

Re: Looping in ksh

2006-12-20 Thread Otto Moerbeek
On Wed, 20 Dec 2006, Uwe Dippel wrote: > I needed some little script; and - as usual - tried it out by typing: > i=0 > uplim=10 > while [ $i -lt $uplim ] > do >((i=i+1)) >echo $i > done > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > > So good, so far. > So I put the history into a fil

Re: Looping in ksh

2006-12-20 Thread Teemu Schaabl
Uwe Dippel([EMAIL PROTECTED])@2006.12.20 18:43:35 +0800: > I needed some little script; and - as usual - tried it out by typing: > i=0 > uplim=10 > while [ $i -lt $uplim ] > do >((i=i+1)) >echo $i > done > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > > So good, so far. > So I put the hi

Re: Looping in ksh

2006-12-20 Thread Sebastian Benoit
Uwe Dippel([EMAIL PROTECTED]) on 2006.12.20 18:43:35 +: > I needed some little script; and - as usual - tried it out > by typing: ^^! > #!/bin/sh ^^! > Question: What is missing in the loop ? nothing, your shell ist ksh, not sh. /B. -- Sebastian Benoit <[EMAIL PROTECTED