'sudo' usually execs things directly and so doesn't need to add quotes when it gets an argument value that includes shell meta characters (like spaces) and so doesn't suffer from what you described (based on my experience and the other reply you got already):
$ perl -le'print for @ARGV' blah "a b c" blah a b c $ sudo perl -le'print for @ARGV' blah "a b c" blah a b c
On the other hand, 'ssh' ends up invoking a shell and also doesn't try to figure out what quotes it would need to add and so requires you to add such:
$ ssh localhost perl -le'"print for @ARGV"' blah "a b c" blah a b c
See how I added an extra set of quotes after -le but not around the last argument and so what gets sent to the shell ends up being:
perl -le"print for @ARGV" blah a b c
Perhaps you are using ssh to invoke sudo but are blaming sudo for your problem? Just a guess.
- tye
In reply to Re: sudo ignoring string entry after first space encountered (ssh)
by tye
in thread sudo ignoring string entry after first space encountered
by perl197
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |