I'm currently trying to run a script with 2 parameters which gets called via a BASH script. The script runs fine however the list of passed parameters , $ScriptCommandLine, always stays empty.

According to the wolfram website the list stays empty , "If the Wolfram Language kernel was run in a way other than via a WolframScript mechanism, the $ScriptCommandLine gives an empty list."

So the script has to use the interpreter #!/usr/local/bin/WolframScript -script. However the raspberry pi version of Wolfram/Mathematica does not have this executable! So i tried using the only executable i found, #!/usr/bin/wolfram -script which leads to the fact that $ScriptCommandLine stays empty.

Do i have to install something additional / Do i have to update something? Or is there any workaround (thought about writting the parameters in a textfile with bash and let the script import these )

  • $\begingroup$ The MathematicaScript executable is at the location /opt/Wolfram/WolframEngine/10.3/SystemFiles/Kernel/Binaries/Linux-ARM/MathematicaScript. But I cannot get it to work. It tells me error: The file /opt/Wolfram/WolframEngine/10.3/SystemFiles/Kernel/Binaries/Linux/WolframKernel is not found or is not executable. It is looking for WolframKernel at the wrong location. I don't know how to change that. $\endgroup$ – Szabolcs Feb 15 '16 at 20:45
  • 1
    $\begingroup$ What's very interesting is that if I look into MathematicaScript (an executable binary), I find references to mash.c. That rings a bell! $\endgroup$ – Szabolcs Feb 15 '16 at 20:49

The wolframscript Wolfram Language script interpreter is now available on the Raspberry Pi and will set $ScriptCommandLine appropriately

pi@testpi3lx:~ $ wolframscript -code '{$Version, $ScriptCommandLine}'

{11.0.1 for Linux ARM (32-bit) (January 17, 2017), 
  {wolframscript, -code, {$Version, $ScriptCommandLine}}}
  • $\begingroup$ It's a pity though that a single run takes 12 seconds ... (overclocked RPi 1 B with 512 MB RAM) $\endgroup$ – Szabolcs Feb 24 '17 at 20:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.