|<B>ssh preserving argsB>||
When running a remote command with ssh, ssh doesnt preserve the separate
arguments it receives. It just joins them with spaces and passes them to
$SHELL -c. This doesnt work as intended:
It creates 2 files, hi and there. Instead, do this:
This gives you just 1 file, hi there.
|<B>process find outputB>||
Its not ordinarily possible to process an arbitrary list of files
output by <B>findB> with a shell script. Anything you put in $IFS to
split up the output could legitimately be in a files name. Heres how
you can do it using <B>shell-quoteB>:
|<B>debug shell scriptsB>||
<B>shell-quoteB> is better than <B>echoB> for debugging shell scripts.
|<B>save a command for laterB>||
<B>shell-quoteB> can be used to build up a shell command to run later.
Say you want the user to be able to give you switches for a command
youre going to run. If you dont want the switches to be re-evaluated
by the shell (which is usually a good idea, else there are things the
user cant pass through), you can do something like this:
<B>--debugB> Turn debugging on. <B>--helpB> Show the usage message and die. <B>--versionB> Show the version number and exit.
The code is licensed under the GNU GPL. Check http://www.argon.org/~roderick/ or CPAN for updated versions.
Roderick Schertler <email@example.com>
|perl v5.20.3||SHELL-QUOTE (1)||2010-06-11|