"Printargs" software enables users to display and print command line arguments in a similar way that "Printenv" does for the environment.
Despite its name, Printargs does more than just print arguments. It was created to facilitate argument manipulation and transmission, with outputs being parsable by Bourne shells. The output is split into stdout and stderr, enabling users to save arguments in a single line of code. You can achieve this using the following code: < pre > saveargs="`printargs args... 2>/dev/null`" ... eval cmd $saveargs < /pre >
To fully parse the output, one can use the following code. However, it should be noted that future versions may add data before the arg0 line: < pre > printargs args... 2>&1 | while read -r what arg do eval data="$arg" ... done < /pre >
It's important to know that Printargs prints line feeds to stderr, not stdout. This feature is intentional to allow for concatenation of argument lists from a loop. Additionally, Printargs doesn't pad arguments with blanks at the beginning or end, but users can add these spaces manually.
Lastly, it's worth mentioning that Printargs escapes characters such as $, ', and blanks in arguments to make it easier to remove ANSI sequence characters with '| tr -d "' $"'. The feature comes with a small readability tradeoff.
Version 0.0.0-20071004-014647: N/A