For some reason, I cannot get AppleScript's "do shell script" to use the latest (GPLv3) Bash:
do shell script "/usr/local/bin/bash; echo $BASH_VERSION"
-- Result: "3.2.57(1)-release"
Strangely, it does work with an external .sh script:
#!/usr/local/bin/bash
echo $BASH_VERSION
Calling it like:
do shell script "~/Library/Scripts/Script.sh"
-- Result: "5.0.17(1)-release"
What's the difference and can I get it to work inside the .scpt script as well?
echo $BASH_VERSION
in the sub shell you created. Whereas the scripts have the she-bang that specifies exactly which shell to execute the code in.do shell script "echo $PATH
" and see if it has the new values before logging out and then again after logging back in.