That
RunThrough["echo", "blah"]
doesn't work appears strange because on my system, OS X, which means the terminal command line is talking to Free BSD Unix, man echo
gives
echo -- write arguments to the standard output
Further, both
RunThrough["cat", "blah"]
and
RunThrough["echo blah", ""]
work.
Update
It turns out the operative phrase in my quote from the Unix man
page is "write arguments". That is, echo
does not accept input from standard input. It only writes the arguments that follow the token echo
on the command line to standard output. The documentation for RunThrough
says the second argument is passed to the OS command mentioned in the first argument by standard input. I assume this means pipped in.
This explains the behavior encountered by the OP and why RunThrough["echo blah", ""]
works.
echo
writes to Window's equivalent of stdout. $\endgroup$ – m_goldberg Feb 8 '17 at 3:22RunThrough
works, the expression that will give you the behavior you expect isRunThrough["cat", "blah"]
$\endgroup$ – m_goldberg Feb 8 '17 at 5:57