in reply to Re^2: Strange SSH Behavior via system or exec
in thread Strange SSH Behavior via system or exec
Either you give system a single argument, which is the equivalent of giving that string to the shell to be executed (e.g. /bin/sh -c 'foo bar quz'), or you give system multiple arguments, in which case you are giving that command its argument list directly, without interpretation by the shell. One of the things the shell does is split arguments on whitespace (except Windows), which no longer happens when you give it "-l usr" as a single string. (While some commands may do their own whitespace splitting of their argv, I'd assume that's rare. Except on Windows, hence the need for something like Win32::ShellQuote.)
|
|---|