MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Use of Mathematica under UNIx

  • To: mathgroup at
  • Subject: [mg30909] Re: [mg30889] Use of Mathematica under UNIx
  • From: "P.J. Hinton" <paulh at>
  • Date: Mon, 24 Sep 2001 01:49:13 -0400 (EDT)
  • Organization: "Wolfram Research, Inc."
  • Sender: owner-wri-mathgroup at

On Sun, 23 Sep 2001 julie.rigaud at wrote:

> I'd like to use unix command in a mathematica programm.
> I thaught that it was possible to do it by using "!" (ex : "! mkdir
> file").
> But it doesn't work.
> So how can I do ?

The exclamation point syntax you describe is an example of special input,
which means that the input _must_ appear at the beginning of a line for it
to be interpreted as such.  This is probably why you are having troubles.

If you want to execute arbitrary shell commands within some Mathematica
code, you can you Run[].  The function returns the exit code provided by
the operating system.  It does not capture output directed to stdout or

If you want to capture output you can use pipe the output to an Import[]

In[1]:= Import["!date", "Text"]

Out[1]= Sun Sep 23 14:33:57 CDT 2001

P.J. Hinton
User Interface Programmer                         paulh at
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.

  • Prev by Date: Re: ReadList, mix Words & Numbers?
  • Next by Date: Re: ConstarinedMin Question
  • Previous by thread: Use of Mathematica under UNIx
  • Next by thread: Gamma Simplification