How to handle more than 10 parameters in shell How to handle more than 10 parameters in shell linux linux

How to handle more than 10 parameters in shell


Use curly braces to set them off:

echo "${10}"

You can also iterate over the positional parameters like this:

for arg

or

for arg in "$@"

or

while (( $# > 0 ))    # or [ $# -gt 0 ]do    echo "$1"    shiftdone


You can have up to 256 parameters from 0 to 255 with:

${255}