bganoush
asked on
How to write while loop on a single line?
Hi ppl,
I have this one line in my shell script that looks like this:
x=`date +"%H"` ; echo $x ; while [ $x -lt 12 ] ; do ; x=`date +"%H"` ; done
It makes sense to me but when I run it, I get this error:
ksh: syntax error: `;' unexpected
What am I doing wrong?
I have this one line in my shell script that looks like this:
x=`date +"%H"` ; echo $x ; while [ $x -lt 12 ] ; do ; x=`date +"%H"` ; done
It makes sense to me but when I run it, I get this error:
ksh: syntax error: `;' unexpected
What am I doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.