Business Intelligence and Analytics
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.
while test $x_start -le $x_end ; do
echo "Processing number: $x_start"
x_start=`expr $x_start + 1`
Get the latest Rocket99 news and tech tips via