Command line Mathematica on Mac OS X
On a Linux machine with a normal install of Mathematica you can usually get access to a command line version of Mathematica by typing
math
at the command line. Command line Mathematica is useful for situations where you want to do batch processing, perhaps as part of a Condor pool or something, but I’ll not write about that until another time.
On a Mac, however, a standard install of Mathematica doesn’t give you a math command so you have to create it yourself. Add the following line to your system’s /etc/bashrc file.
alias math="/Applications/Mathematica.app/Contents/MacOS/MathKernel"
Now, when you type math at the command prompt it will behave just like a Linux system which is sometimes useful.
That’s unusual. Even the Windows version includes math.exe, which runs in command line mode, in addition to MathKernel.exe, which draws its own terminal window.
Why on earth, in the year 2010, should anyone want to use a command line version of any program?
PS:
I’m 43 and ages ago I was using command line progs…
Hi GG
I use command line programs all the time for system administration and so on. Simply put – they can be significantly faster than GUI alternatives when you know what you are doing. I’m not particularly hardcore about this though – I use GUIs when it makes more sense to.
As for command line Mathematica – the reason I am interested in it is because I am collaborating on a research project that is in need of some batch processing via Condor and using command line mathematica is the easiest (only?) way to do this. Maybe I’ll blog about the details sometime.
Cheers,
Mike
For Maple it’s
/Library/Frameworks/Maple.framework/Versions/Current/bin/maple
@GG, another reason might be if you’re using Mathematica remotely. That’s why I came across this post: I want to run a simulation on a powerful Mac workstation over ssh, but I couldn’t figure out how to run Mathematica from the commandline. Thanks, Mike!