Re: Input in batch script
- To: mathgroup at smc.vnet.net
- Subject: [mg30374] Re: [mg30296] Input in batch script
- From: Omega Consulting <omega_consulting at yahoo.com>
- Date: Sun, 12 Aug 2001 02:30:02 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Clear["Global`*"]
a = 1;
number = Input["Enter number, e.g., 99 : "];
sumnumber = a + number;
sumnumber >> foo1.out
string = InputString["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"<>string<>".out"
At 12:33 AM 8/8/2001, Carlo Palmisano wrote:
>Hi,
>
>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 ****
>Clear["Global`*"]
>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 batchfoo.com *)
>
> **** foo.m end ***********
>
>The relevant batchfoo.com (executable)
>contains
>
>math <<end1 >>foo.out
><<foo.m
>99
>"1212_800"
>end1
>
>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 to.infn.it