In Mathematica 11, there is new wolframscript.exe
According to help wolframscript.exe -h
-f [ -file ] arg---------Run a Wolfram Language file from the commandline.
-script arg------------Run Wolfram script, backwards compatible.
I created a test.wl
file with content below
#!wolframscript
SetDirectory[DirectoryName[$InputFileName]];
Print[Directory[]]
Running wolframscript -script test.wl
is fine.
But running wolframscript -f test.wl
will give errors
SetDirectory::fstr: File specification is not a string of one or more characters.
Why the error? What is the difference between "wolframscript -f" and "wolframscript -script"?
Comments
Post a Comment