![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error: initializer expression list treated as compound expression | arunchaudhary19 | High Level Programming | 12 | 11-16-2007 06:44 AM |
| Help with Reg. Expression | moe2266 | UNIX for Dummies Questions & Answers | 7 | 07-16-2007 04:05 PM |
| OR expression | Rock | UNIX for Dummies Questions & Answers | 3 | 05-03-2007 08:50 AM |
| KSH Expression | tmarikle | Shell Programming and Scripting | 4 | 09-28-2005 04:27 PM |
| Regular Expression + Aritmetical Expression | Z0mby | Shell Programming and Scripting | 2 | 05-21-2002 10:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Expression syntax
Hello, I am getting Expression syntax message and I cannot figure out what's wrong. This program will print all the odd numbers between 0 and the one the user enters, in cshell. I think my logic is either good or almost there, but i dont see the errors. I think it could be the spaces between characters, maybe? Thanks !
Monika This is what I have: odds: #!/bin/csh # Print out all the odd numbers between 1 and a number user specifies # If user enters a negative number, print out an error message echo "Enter your number: " set number = $< set x=1 while ($x <=$number) echo $x @x =$x + 2 end |
|
||||
|
You need a space between the '@' and the variable. Try
Code:
@ x=1 while ($x <=$number) echo $x @ x += 2 end |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|