| Keywords: | arguments,list,debug |
|---|---|
| Contributor: | Snappy at #bash on Freenode |
Sometimes you might find it useful to see how arguments passed to a program arrive there.
Check this script (save it as script file or make a function):
printf '"%b"\n' "$0" "$@" | nl -v0 -s": "
It uses the printf command to generate a list of arguments, even with escape sequences interpreted. This list is shown formatted by the nl(1) utility.
Discussion