Linux Programmer | RHCE | RHCSA

Search This Blog

Tuesday, 31 July 2018

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"
    shift
done

No comments:

Post a Comment

M3 Button not working in Wayland

Mouse M3 button not working in wayland - ubuntu 26.04 1. Check your desktop Run: echo $XDG_SESSION_TYPE echo $XDG_CURRENT_DESKTOP 2. If...