You need to understand the differences between "$*" and "$@" (which can only be used as "$@" or it reverts to a $*). The "$@" returns the arguments in a quoted form.
for argtext in "$@"; do
let index=${index:-0}+1
echo "Argument ${index}: is '${argtext}'"
done
for example:
$ my_cmd...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.