Reputation:
If I run Mathematica as "math foo bar", what variable(s) hold foo and bar? I'm guessing it's $Something, but haven't found it.
Googling told me Mathematica accepts command-line options like -pwpath, -pwfile, but I couldn't find the right search phrase for actual command line arguments (not options).
Upvotes: 3
Views: 230
Reputation: 18271
The $CommandLine
variable holds the command line arguments.
$ math foo bar
In[1]:= $CommandLine
Out[1]= {math, foo, bar}
Upvotes: 7