Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ ReadString["!cat"] is also useful here. I must say I don't really understand why your answer works, but that makes it more impressive that you found out about it. $\endgroup$ Commented Dec 14, 2015 at 17:08
  • $\begingroup$ @JacobAkkerboom I didn't actually know about ReadString, it seems to be new in 10. Why are you saying that you didn't expect ReadList to work? It reads expressions by default, which is convenient for numbers, bt otherwise dangerous ... ReadList["!prog", String"] is safer ... $\endgroup$ Commented Dec 15, 2015 at 11:26
  • $\begingroup$ my confusion was more about this use of cat without arguments. But I see now the line in man page of cat (CAT(1)): "If file is a single dash (`-') or absent, cat reads from the standard input". I am still impressed that cat connects to the standard input of the script correctly. $\endgroup$ Commented Dec 15, 2015 at 12:09
  • $\begingroup$ @JacobAkkerboom I do not remember why I wrote this. It might have been an unfortunate example ... or maybe on Windows this brings up a command prompt where one can type? It's more likely that it's just a bad example. I'll correct it. $\endgroup$ Commented Dec 15, 2015 at 12:48