I have a script that behaves differently when run by name compared to when it is run via a symbolic link. The problem is specific to WSL/Ubuntu. The same script, when used under Linux or Windows/Cygwin, behaves correctly in both cases. I’m trying to make it portable to all three systems.
A simplified demonstration of the problem is described here on Mathematica StackExchange.
Although my encounter with this problem is specific to wolframscript, I suspect it is actually more closely connected to WSL/Ubuntu than to Mathematica, which is why I have cross-posted it here. (That might have been unnecessary had I been able to apply a windows-subsystem-for-linux tag there.)
The use of env
in the first line of the batch file,
#!/usr/bin/env wolframscript
is apparently essential for portability but is also hampering my ability to debug what is going wrong.
Is the problem specific to WSL/Ubuntu, my $PATH, my .bashrc file, or something else?
If you can help me understand and fix the problem it would be much appreciated.