Here's a simple script saved in the file hello
#!/usr/local/bin/MathematicaScript -script
Print["Hello world"]
I can then run this file using math -script hello or,
if the file is set to be executable, ./hello.
In Windows or OSX, run MathKernel -script hello
It prints
"Hello world"
to the terminal.
How can I change this so it does not print the quotation marks?
Printfor outputting warnings in this superuser question. Is there a better way of printing warnings to the terminal? – Simon Jan 25 '12 at 04:17Message, which seems to be the usual way to handle warnings in Mathematica (I think). – David Z Jan 25 '12 at 07:50Messages[General]does not contain an appropriate message for me to use). – Simon Jan 25 '12 at 08:05./helloshould also work on OS X if the script is executable (and you have the right shebang) – acl Jan 25 '12 at 10:04