At UNIX command line, one can run ls -la $HOME
. How to trigger this from Mathematica notebooks?
Run["!ls -la $HOME"]
32512
Returns some integer -- what is it? -- but not the normal output.
At UNIX command line, one can run
Returns some integer -- what is it? -- but not the normal output. |
||||
|
The
you'll also get an error). Why it returns If you start a raw kernel and type
(without exclamation mark) you'll see the output of the If you are interested in the actual output, you have to use a file reading command, and use the special "!" syntax; for example
giving you all the output in a single string, or
giving you a list of strings, each containing a single line of the output. Note that the exclamation mark says you want to get the output of a command instead of the contents of a file (whose name would have gone at that point otherwise). That's why you don't put the exclamation mark at the If you need both the output and the exit code, apparently in version 10 you can use
|
|||||||||||||
|
|
||||
|
"Run" does not return the output of the command. On windows I can do For more information see http://reference.wolfram.com/language/tutorial/ExternalPrograms.html |
|||
|