This is an old revision of the document!


Print argument list for testing

snipplet:
debug, arguments
LastUpdate:
2010-07-31
Contributor:
Snappy (IRC)

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.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
You could leave a comment if you were logged in.
  • snipplets/prargs.1280567177.txt
  • Last modified: 2011/06/24 05:10
  • (external edit)