我想在 Mathematica 中编写命令行脚本,但似乎找不到Argv[i_Integer]
类似的函数。(否则文档非常棒。)
问问题
2035 次
3 回答
6
假设您使用MathematicaScript for scripting,似乎$ScriptCommandLine是您需要的变量。如果您使用,否则它将是$CommandLine。math
MathKernel -script
于 2011-11-01T20:52:48.440 回答
4
$CommandLine
适用于 Mathematica、MathematicaScript、MathKernel 和数学。
args.ma:
#!/usr/bin/env MathKernel -script
Print[$CommandLine]
例子:
$ ./args.ma a b c
{"MathKernel", "-script", "./args.ma", "a", "b", "c"}
于 2011-11-02T17:18:34.427 回答
1
于 2011-11-02T01:07:36.400 回答