Of Interest
Business Intelligence and Analytics
Oracle Training
|
UNIX
»
Shell
»
»
Looping in a script, via a counter
Looping, with counter, works in sh, bash, and ksh.
Loops are done inclusive of start and end numbers .. so
if you pass 1 and 6 as parms .. it will loop 6 times.
Syntax is difficult to remember .. bookmark this page.
#!/bin/ksh
x_start=$1
x_end=$2
while test $x_start -le $x_end ; do
echo "Processing number: $x_start"
/export/home/tester/test_runner.ksh $x_start
x_start=`expr $x_start + 1`
done
|
|
|
Get the latest Rocket99 news and tech tips via
|