On 8 Jun 2005, at 13:22, Kevin O'Riordan wrote:
>>> As Niall pointed out, you could probably join the arguments together
>>> as a single string before calling system() with that single argument.
>>> Then the shell would get to parse the line ...
>>> As the man page you quoted points out, the shell is only involved when
>> the command line for system contains shell metacharacters. Martin's
>> didn't so his perl program won't use the shell.
>> According to the bash manpage, an unquoted space character itself is a
> shell metacharacter. A little testing shows that you're right though
> the shell is not called when the example arguments are joined together.
> I guess perl has it's own idea of what shell metacharacters are?
I guess an unquoted space character itself is a shell metacharacter
only in so far as it acts as a separator. perl doesn't worry about
that, because if a system command line has no OTHER shell
metacharacters, perl splits the command line on whitespace, and calls
execvp directly with the results of that split.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!