I can't see any syntax on this page for using 2 files with the -script
option (and as MB1965 points out, the help does say that only one script file can be used with the -script
option). I do have some experience running WL files from the command line in Mathematica in batch mode, all of which I learned from Jens's page here.
If I create a file called "script1.wl" with the contents
x1 = 3;
x2 = 4;
and another file in the same directory, "script2.wl", with
Print[x1 + x2];
Exit[]
and then run this command from the same directory
math -noprompt -run "<<script1.wl;<<script2.wl" > output
where I've set math
up as an alias in my shell to the MathKernel
application, then the output
file has a single line
7
-script
option. What happens if you simply use$math -run "<<input;<<script1.wl;<< script2.wl" > output
? $\endgroup$Get
) instead of from within a shell script? $\endgroup$