13

Simple loop using for

view full story
linux-howto

http://www.unix.com – Dear experts, I am writing a bash script. At some point of the program I need to have 'for' loop. For simplicity I tried with some other simple code. The format of the loop is given below. Code: k=51 m=55 for j in {$k..$m};do         w=$(($j+2))         z=$(($j+9)) echo "$w, $z" done But my code is fail to run. Basically I want the k and m to variable. Can anyone address some point here? Appreciate any help in advance. Thanks (HowTos)