如果做"math foo bar",如何在Mathematica中获得foo和bar?

bar*_*ter 3 wolfram-mathematica

如果我将Mathematica作为"math foo bar"运行,那么什么变量可以保持foo和bar?我猜它是$ Something,但还没有找到它.

谷歌搜索告诉我Mathematica接受命令行选项,如-pwpath,-pwfile,但我找不到实际命令行参数(不是选项)的正确搜索短语.

WRe*_*ach 8

$CommandLine变量包含命令行参数.

$ math foo bar
In[1]:= $CommandLine
Out[1]= {math, foo, bar}
Run Code Online (Sandbox Code Playgroud)