Issue:When I try to open any shell scripts a new window is spawned, which exits immediately. Files .bash_profile, .bashrc and a helloworld.sh are tested examples.Interestingly, running open helloworld.sh outputs:Jake:~ jakebanks$ /Users/jakebanks/helloworld.sh; exit;Hello World!logoutWhich seems to say it executed successfully. The output of echo ${PIPESTATUS[0]} (in the first window) is 0.Config:Recently I changed my default terminal to iTerm2, and this is the most recent change I can recall making before having this issue. Default text editor is Sublime Text 2. Default shell is bash.FWIW, the issue is terminal agnostic.Contents of .bash_profile are (for now):PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbinexport PATHThe contents of .bashrc:#!/bin/bash#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!export SDKMAN_DIR=/Users/jakebanks/.sdkman[[ -s /Users/jakebanks/.sdkman/bin/sdkman-init.sh ]] && source /Users/jakebanks/.sdkman/bin/sdkman-init.shWhat I've tried:Changing shellsOpening non-shell-script files (e.g. text files) with successResetting profiles to their defaults in both Terminal and iTerm2Solution:It turns out that I was confused about how shell scripts are invoked from the terminal. The command actually should have been sh helloworld.sh, rather than open helloworld.sh
OS/X: can't execute shell scripts - spawns a new window which exits immediately
bash;shell script;osx;iterm