Message Boards Message Boards

Running a script file from console?

Posted 8 years ago

Hi, I have a mathematica script (.m file) which contains

(* ::Package:: *)

\[Nu]=0.25;
\[Rho]=1.7;
l=100;
q=157.5;
p=175;
a= 9.8;
H=8;

G[h_]:=\[Rho] (p^2) (1+I \[Delta]) ((q/p+(1-q/p)(1-h))^2)

\[Lambda][h_]:=(2 \[Nu])/(1-2 \[Nu]) G[h]

and then I run the following command. But as you can see it, returns to the prompt and there is no log file containing the result. Any idea on that?

mahmood@cluster:~$ MathKernel -noprompt -run < M-S.m
mahmood@cluster:~$ 

Thanks

POSTED BY: mahmood n
2 Replies
Posted 8 years ago

Thank you very much. it is now OK. There are still some questions that I will ask later.

POSTED BY: mahmood n
Posted 8 years ago

This

math -noprompt -run < script.m > log.txt

creates a log file of the evaluation.

Your script only defines constants and functions and does not calculate a result. Adding a line like

\[Lambda][2]

to the end of your file will then calculate the value of that function and append that to the log file.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract