[jump to content][No Software Patents]Tools (new) : printargs [ Home | Scylla+Charybdis old home | Tools (old) | Tools (new) | FAQ | Downloads ]

Moving to GitHub, slowly

The software on this pages will slowly be moved to GitHub https://github.com/hilbix/. The CVS repository will be migrated to GIT as well, so the history will be preserved, a bit. See FAQ.

Scylla and Charybdis, printargs - Tools

The tools are developed under Linux with ESR's paradigm release early, release often in mind.
So you can consider this beta software, or alpha, or pre-alpha, or even worse ;)

Have a look in the download directory for all downloads.
As always here, all you get is the source. No binaries here.

printargs 0.0.1-20080531-225835

Like "hello world" but dumps the argc array


⇒ ⇒ ⇒ The development shifted to another location. All future versions will be published at https://github.com/hilbix/printargs   ⇐ ⇐ ⇐


There is printenv, but no corresponding printargs. /bin/echo doesn't do the job, as it has options and you cannot tell if args have blanks or not.

This Works is placed under the terms of the Copyright Less License, see file COPYRIGHT.CLL. USE AT OWN RISK, ABSOLUTELY NO WARRANTY.

Actually, it does print a little bit more than just args and was designed for easy shell usage for argument manipulation and transmitting.

The output can be parsed by bourne shells again and is splitted onto stdout and stderr, such that you can use following code to save the arguments into a single line:

saveargs="`printargs args... 2>/dev/null`"
...
eval cmd $saveargs

The full output can be parsed as follows. However you must be prepared that future versions may add more information right before the arg0 line:

printargs args... 2>&1 |
while read -r what arg
do
eval data="$arg"
...
done

Note that printargs prints linefeeds to stderr and not stdout. This behavior is intentional to be able to concatenate argument lists on stdout from a loop.

Also note that printargs does not pad arguments with blanks at the beginning nor at the end, so you have to add these blanks yourself.

In args chars $, ' and blanks are escaped such that you can easily remove those ANSI sequence characters with '| tr -d "\' \$"'. This feature is intentional with a little readability tradeoff.

History:

version 0.0.1-20080531-225835

download (5435 bytes) sig

Bugfix: ANSI escape fixed, the octal sequence was too long for most control characters (hadn't tested this before).

version 0.0.0-20071004-014647

download (5158 bytes) sig

First version, it works

License and Disclaimer

All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2011 by Valentin Hilbig
Note that the software comes with absolutely no warranty of any kind.
You use the software at your own risk.
Valentin Hilbig cannot be hold responsible for any unintended damage,
lost data or malfunction of the software you can find here.

[FSFE contributor 2007]

[end of page - jump back to content][hacker culture]
Last modified: 2011-09-12 by Valentin Hilbig [ Imprint / Impressum ]