MathGroup Archive 2004

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

Search the Archive

RE: Mathematica 5.0 "RunThrough" Command

  • To: mathgroup at
  • Subject: [mg45343] RE: [mg45322] Mathematica 5.0 "RunThrough" Command
  • From: Noffke Harold W Civ AFRL/SNRP <Harold.Noffke at>
  • Date: Thu, 1 Jan 2004 05:54:34 -0500 (EST)
  • Sender: owner-wri-mathgroup at


Thanks.  I did "go figure" a bit, and found more baffling execution patterns.

Following your advice, I got ...

	Run["type", "init.m"]

What happened here is that the DOS box flashed on momentarily, just long enough for me to confirm that I was indeed in the correct current directory ("C:\PROGRA~1\WOLFRA~1\MATHEM~1\5.0"), and init.m text was being typed to the DOS box screen.  However, no text appeared in my Mathematica Notebook.

Now, here is a !-expression without quotes, which does not parse correctly before DOS executes it (I see *no* DOS box flash) ...

In[29]:= ! type init.m > c:\xxx.1.txt
Syntax::sntxb :
 "Expression cannot begin with \"\!\(\(\(\\
   xxx\)\)\(\(.2 . txt\)\)\)\".\!\(\"\"\)
   \!\(\*ButtonBox[\"More...\", ButtonStyle->
   \"RefGuideLinkText\", ButtonFrame->
   None, ButtonData:>\"General::sntxb\"]\)"

Here is a second !-expression which uses quotes, and parses correctly *before* DOS executes it correctly -- the DOS box flashes on briefly, and file xxx.2.txt is correctly created in C:\ -- but seems to leave Mathematica with some residual parsing to do *after* DOS executes "expression".

In[31]:= ! "type init.m > c:\xxx.2.txt"
Syntax::stresc :
 Unknown string escape \x.  More...

Looking at these results, I gather the correct syntax is " ! "expression" ", rather than "! expression", and continue to wonder why Mathematica continues parsing after the DOS command expression is executed.  I have yet to find a "Run", "RunThrough", or "!" expression syntax which types init.m into my Notebook's Output cell.

Anyone else know what variations on all this will work for Windows users?


-----Original Message-----
From: Yasvir Tesiram [mailto:tesiramy at]
To: mathgroup at
Subject: [mg45343] Re: [mg45322] Mathematica 5.0 "RunThrough" Command

Try this,
In the first instance use SetDirectory to change to the directory where
your file is or Append it to your Mathematica $Path variable. Then,

Run["type", "init.m"]
!type init.m

At least these two methods do what you are expecting them to do and
are better explained by the documentaion for RunThrough
rather than for Run or !.

Go figure.

Happy New Year


  • Prev by Date: multiple derivatives?
  • Next by Date: Re: Printing "Alias" Definitions
  • Previous by thread: Re: Mathematica 5.0 "RunThrough" Command
  • Next by thread: multiple derivatives?