# Problem under Linux executing bash script:
# After making sure that the script as "scriptpath" is there,
# I run
var output = []
var res = OS.execute( "bash", [scriptpath], true, output)
# and get the following error: 127 (= file not found)
# I think: OK, bash is somehow missing. But I know it is under
# "/bin/bash". However, replacing plain old "bash" with
# "/bin/bash" doesn't help.
# I am wondering it I don't understand something about using
# OS.execute, so I try some other Linux program by comparison, and:
res = OS.execute( "file", [scriptpath], true, output)
# returns 0 (expected value), so scriptpath is there.
# It is apparently not finding bash. To test this, I try
result = OS.execute( "bash", ["--help"], true, output)
# and it works! So bash is there, too, just not in combination
# with my script.
# It dawns on me that the bash script may not be executable?
# So I run a previous chmod on it, like this:
res = OS.execute( "chmod", ["u+x", scriptpath], true, output)
# which is successful, followed immediately in my code by
res = OS.execute( "bash", [scriptpath], true, output)
# and still: no dice.
# Now it dawns on me: Since the script is now executable, I don't
# need to call bash first, but just call the script, like this:
res = OS.execute( scriptpath, [], true, output)
# nope! Likewise:
res = OS.execute( scriptpath, [""], true, output)
# I am at the end of my wits here. Any help?