I want to run some lines of Mathematica8 code by a command-line call for math. As a test, I save just the following code in a file test.m:
Put[1+1,"/home/tghfsi/Desktop/Test.txt"];
but when I type in Linux terminal:
tghfsi@Toughee:~$ math -script /home/tghfsi/Desktop/Test.m
the file Test.txt
is not created and it seems that nothing has happened. Since the code results correct when I execute it in Mathematica notebook and the .txt
file is created in specified place, the problem cannot be from code or file path specification. What I'm not sure about is that if the above command pass the .m
file to math kernel, at all. As a not trained Mathematica 8 user, I'd appreciate any useful answer or comment.