Running a script file from console?

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

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.

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