Skip to content

use of "input" in system()

1 message · Duncan Murdoch

#
On 30/04/2009 12:54 PM, Mike Miller wrote:
I'd say the latter.
It's not quite correct.  It does the same thing as that does, but it 
doesn't do that:  the < sign is interpreted by the shell to tell it to 
redirect stdin.

   It would have
Those are different on Windows at least.  The first one will probably 
fail, because very few commands other than shells know how to interpret 
"<".  You need the shell to interpret the "<" sign as a signal to 
redirect input.

Check the man page for a description of this on other systems.

Duncan Murdoch