I have to write a script, which will take all arguments and print them in reverse.
I\'ve made a solution, but find it very bad. Do you have a smarter idea?
Portably and POSIXly, without arrays and working with spaces and newlines:
Reverse the positional parameters:
flag=''; c=1; for a in "$@"; do set -- "$a" ${flag-"$@"}; unset flag; done
Print them:
printf '<%s>' "$@"; echo