Bash scripting question

listmail@rotundus.com listmail
Mon May 17 11:47:51 PDT 2004


Brad De Vries wrote,
> You could try:
> ---------
> TOTCNT=$#
> for ((NUM=1; NUM <= $TOTCNT; NUM++))
> do
>   echo "$NUM: $1"
>   shift
> done
> ---------

Wouldn't this kind of leave me stuck if I were to want to do something
with any of the parameters later on?  I notice from the man page that you
can't shift them back.

Thanks for the suggestion.

David Aikema




More information about the Linux-users mailing list