I am interested in running the same experiment with the different initial state. So, I am looking for a way to passing arguments into a plain text .m file from the command line.

  • $\begingroup$ Have you seen the tutorial on Wolfram Language Scripts? And have you seen the documentation for $CommandLine and $ScriptCommandLine? $\endgroup$ – C. E. Jul 14 at 20:17
  • $\begingroup$ @C.E. Thank you. I am using a cluster (Sun Grid Engine), and the format of the WL file that may run on it is ".m". I have seen this tutorial, but I think that the way to pass arguments to script and package is not similar, I am wrong? $\endgroup$ – Kiril Danilchenko Jul 14 at 20:26
  • 1
    $\begingroup$ I wouldn't mix the command line interface and the package, I would put a script file next to the package that loads the package and looks at the command line arguments to do what needs to be done. This script can have the ending .m, it won't matter. $\endgroup$ – C. E. Jul 15 at 7:17
  • $\begingroup$ @C.E. thank you. I will try this approach. $\endgroup$ – Kiril Danilchenko Jul 15 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.