Hi there.
I spent too much time away from Unix, now I can't remember how to issue a simple until command in ksh
could you tell me what is wrong with the following code sample:
export v = "1"
until [ $v -lt 5 ]
do
echo 'executing repeat_until'
v = `expr $v + 1`
done
I've already tried adding the semicolon to the end of the until line, in addition to a lot of other trials, but none of them made effect
Thanks for any help.
Next time, tell us what result you get!!! Do not just say that "what is wrong". A clue as to what system would be nice too...
You cant do:
export v = "1"
v = `expr $v + 1`
No spaces around the equal signs. You need to do:
export v="1"
v=`expr $v + 1`
don't need the 'export'
loose the spaces around '='
well...... wouldn't the above always be 'true' if you start with 'v=1' ?
how 'bout:
#!/bin/ksh
typeset -i v=1
until (( v > 5 ))
do
echo 'executing repeat_until'
v=$(( v + 1 ))
done
Sorry for my loose details on the problem, Perderabo.
And thanks for you both, my problem were indeed the spaces