in reply to Unsuccessfully passing arguments to a bash command
or better yet,system(q{bash -ic 'untouchable john mike bill'});
system('bash', '-ic', 'untouchable john mike bill');
The latter launches bash directly instead of launching a sh to launch bash.
If the names are variable, you want:
oruse String::ShellQuote qw( shell_quote ); system('bash', '-ic', shell_quote('untouchable', @names));
system('bash', '-ic', 'untouchable "$@"', '-', @names);
If I run untouchable from the command line, it works as expected.
But running the command you passed to system wouldn't have.
|
|---|