Actually, iteration over a range of integers is fairly uncommon in shell scripts. But the "((" notation would would in the bash shell. Other shells, such as the Korn Shell (which IBM likes to use) have different conventions. For ksh, it would be
You can generally tell what shell you're using by issuing the "echo $SHELL" command at the command prompt.
Joined: Sep 23, 2011
I got "/usr/bin/sh" for the command echo $SHELL. so which command it is ?
The technical name for this first line is "shebang" and its significance is that when the script is marked executable and invoked directly from the command line, whatever program named in that statement will be used to run the script.
I did a quick check to see what the "/usr/bin/sh" program in hp-ux is and discovered that apparently it is a modified Korn shell with changes made that supposedly make it more Posix-compatible.
So instead of using bash syntax, you need to be using ksh syntax. Either that or run the script under bash (if it's available).