|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ksh while loop
hi all,
got this silly problem and i just can't seem to make sense of the error message its is saying 1400: cannot open. its my first time at writing a while loop but tried all sorts to get it working without success. #!usr/bin/ksh integer max=1400 set file="afilename" integer i=1 while i < $max do # $(echo value of is : $i >> $file) echo value i: $i i = $i + 1 done thanks Mani |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
#!usr/bin/ksh integer max=1400 set file="afilename" integer i=1 while [[ $i -lt $max ]] do # $(echo value of is : $i >> $file) echo value i: $i (( i = i + 1 )) done |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
Another "mathematical way": Code:
max=1400 set file="afilename" i=1 while (( i <= max )) do # $(echo value of is : $i >> $file) echo value i: $i (( i += 1 )) done |
|
#4
|
|||
|
|||
|
thanks got it working.
![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| S# in a for loop - concatenate $(loop counter) | fight4love | Shell Programming and Scripting | 5 | 07-05-2011 11:42 PM |
| BASH loop inside a loop question | rethink | Shell Programming and Scripting | 4 | 09-15-2010 07:58 AM |
| Null Handling in Until loop. . .loop won't stop | brandono66 | Shell Programming and Scripting | 4 | 11-24-2009 03:57 PM |
| Using variables created sequentially in a loop while still inside of the loop [bash] | DeCoTwc | Shell Programming and Scripting | 2 | 06-23-2009 04:59 PM |
| how to get the similar function in while loop or for loop | trynew | Shell Programming and Scripting | 3 | 06-17-2002 11:09 AM |
|
|