Simulate shell environment available to GUI Apps?
First, let me solve the problem of a GUI app not providing the same environment as a terminal session to a bash script.

The differences are because of your bash profile, so you can have exactly the same in a GUI shell script by using the source command. Put the line source /Users/&lt;username&gt;/.bash_profile (replacing &lt;username&gt; with your short name) at the top of your bash script and you will have the same environment in the script when run inside a GUI app as in your shell session.

To get a shell without running your profile in iTerm2 (I couldn't get it to work in Terrminal):


Open to Terminal->Preferences
Go to the Profiles pane
Duplicate your default profile
In "General"
Change the name of the new profile to "No Profile"
Set the shortcut key to Control-Command-A
Click on "Command"
Set the command to /bin/bash -norc
Close the Preferences


Now Control-Command-A will open a session exactly the same as a GUI app would get - everything set to the bash default.