Article pages now have a discussion option at the bottom (moderated/captcha, but no registration needed)

Print argument list for testing

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

Enter your comment
 
snipplets/prargs.txt · Last modified: 2009/02/24 07:18 (external edit)
GNU Free Documentation License 1.2
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0