in reply to Re^4: Strange SSH Behavior via system or exec
in thread Strange SSH Behavior via system or exec
As soon as you give system more than one arg, it does not invoke the shell (see also exec), meaning that the arguments such as "-l usr" are passed on to ssh without interpretation by the shell, usually causing the command to interpret them literally.
In your example, there is only one argument to system, so whitespace is interpreted as it would normally be by the shell (more precisely, if there are shell metacharacters, the command is passed to the shell, if there aren't, the command is split on whitespace and executed directly).
|
|---|