MathGroup Archive 2001

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

Search the Archive

Input in batch script

  • To: mathgroup at
  • Subject: [mg30296] Input in batch script
  • From: Carlo Palmisano <palmisano at>
  • Date: Wed, 8 Aug 2001 01:33:53 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Question (partially Mathematica, partially Linux):
      We have to pass two values  (one integer and one string)
      to a  mathematica foo.m running in batch.
      The integer is simply used in a sum;
      the string has to be concatenated into a file name (Output)

Let's imagine to have the following trivial program  "foo.m" 
which requires two inputs (one integer and one string)
               from the keyboard 
BUT has to run in **batch** (Linux with Mathematica 4.1).

                   *** foo.m begins ****
a = 1;
number = Input["Enter number, e.g.,  99 : "];
sumnumber = a + number;
sumnumber >> foo1.out
string = Input["Enter the string, e.g.,  1212_800 : "]
string >>> foo1.out
m1 = MemoryInUse[]
sol = NDSolve[{y''[x] - y'[x] + y[x] ==0,y[0]==1,y'[0]=1},y[x],{x,0,3}]
m2 = MemoryInUse[] 
m3 = (m2-m1) >>> foo???????.out

(*We have to replace foo???????.out with foo1212_800.out
    where 1212_800 is read from the following *)

                     **** foo.m end ***********

The relevant (executable)

math <<end1  >>foo.out

The trouble lies in the line
m3 = (m2-m1) >>> foo??????.out

What shall we have to do in order to get
                foo1212_800.out ?

Can you tell us how to modify the foo.m and the script ? 
Several trials with, e.g., ToString failed.

Many thanks for your help.

Carlo Palmisano
University of Turin
via P. Giuria 1 - 10125 Torino - Italy
e-mail: palmisan at

  • Prev by Date: From the MathGroup/Newsgroup Moderator
  • Next by Date: TeX and virtual fonts
  • Previous by thread: From the MathGroup/Newsgroup Moderator
  • Next by thread: Re: Input in batch script