The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell running setup in Korn ? Browser_ice Shell Programming and Scripting 4 08-14-2006 05:22 PM
Help with Korn Shell script heprox AIX 1 12-19-2005 11:04 AM
korn shell script pavan_test UNIX Desktop for Dummies Questions & Answers 3 10-27-2005 09:09 AM
korn shell script pavan_test UNIX for Dummies Questions & Answers 1 10-26-2005 10:17 AM
Multiple su - in Korn Shell script furrari Shell Programming and Scripting 2 07-30-2004 06:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-11-2006
Registered User
 

Join Date: Aug 2006
Posts: 5
Korn Shell script not running

I am sorry, this is really trivial, yet I am not able to understand what the problem is!
I am using korn shell and running this script

Code:
#!/bin/ksh
keep=3
while [ $keep -eq 1 ]; do
echo $keep
keep=$(($keep-1))
done
I am getting this error:
Code:
`keep=$' unexpected
I am not able to understand it because
Code:
keep=$(($keep-1))
works fine on prompt.

Please help regarding this.
Thanks
Asty
Reply With Quote
Forum Sponsor
  #2  
Old 08-11-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,656
Your script did not generate that error when I ran it. I changed -eq to -ne so it would loop and still no trouble.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0