Advertisement

06.24.2008 at 08:28AM PDT, ID: 23511382
[x]
Attachment Details

How to write while loop on a single line?

Asked by bganoush in KornShell (ksh), Unix Systems Programming

Tags: ksh script AIX

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?Start Free Trial
[+][-]06.24.2008 at 10:25AM PDT, ID: 21858103

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: KornShell (ksh), Unix Systems Programming
Tags: ksh script AIX
Sign Up Now!
Solution Provided By: tfewster
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628