If you do "math foo bar", how to get foo and bar inside Mathematica?

If I run Mathematica as a "math foo bar", which variable has foo and a bar? I guess this is something, but have not found.

Googling told me that Mathematica accepts command-line options such as -pwpath, -pwfile, but I could not find the correct search phrase for command-line arguments (not parameters).

+3
source share
1 answer

The $CommandLine contains command line arguments.

 $ math foo bar In[1]:= $CommandLine Out[1]= {math, foo, bar} 
+8
source

Source: https://habr.com/ru/post/900565/


All Articles