I'm trying to use the Run Program() command to execute the unix command "/usr/bin/which -a Python3". I'm still learning so sorry if the answer seems obvious. For the record, I'm running JMP Pro 17.2 on MacOS Sonoma 14.7.1. The Mac thing is important to note, as there seem to be some subtle syntax differences from PCs.
Attempt 1 (just confirming Run Program works):
RP = Run Program(
Executable("/usr/bin/which"),
Options({"Python3"}), //No "-a" modifier
readFunction("text")
);
This doesn't give any error, but only returns one instance of Python3 ("/usr/bin/Python3"), and I'm looking for all instances of Python3 on the user's computer. But it at least demonstrates to me that I can get the Run Program function to work.
Attempt 2 (adding the "-a" modifier):
RP = Run Program(
Executable("/usr/bin/which"),
Options({"-a Python3"}),
readFunction("text")
);
This fails, and returns:
"/usr/bin/which: illegal option --
usage: which [-as] program ...
"
Attempt 3 (using slightly different syntax):
RP = Run Program(
Executable("/usr/bin/which"),
Options({"-a", "Python3"}), //"-a" is now a separate list item
readFunction("text")
);
This does not fail, but returns the same thing as in my first attempt (as if there were no "-a" modifier):
Attempt 4 (creating a bash script and executing the 'which' command from that instead):
I created the simple text file and saved to my Desktop
#!/bin/bash
/usr/bin/which -a python3
Then I ran this in JMP:
</CODE><CODE class=" language-jsl">RP = Run Program(
Executable("/bin/sh"),
Options({"/Users/stefannikles/Desktop/usrbinwhich.txt"}),
readFunction("text")
);
This did not return an error, but only "".
I've tried several other things, but none seem to work. Any advice anyone can provide will be appreciated. Thanks.