Probably what has happened is the GRASS brew did something stupid and added that line to the end of either your ~/.bash_profile
or ~/.bashrc
or possibly ~/.profile
file (~
is your home directory - something like /Users/Willburt
). Unfortunately I'm not at my Mac now to test this, but try opening Terminal.app, going to the Preferences, and in the Startup tab select "Shells Open With: Command (Complete Path)" and type in env - "$(command -v bash)" --noprofile --norc
. This will start up bash
(the standard login shell on OSX) but not execute any of the files I mentioned above.
Once you're in, use /bin/ls -la
to list all the files in your home directory, including the "hidden" ones (those that start with a .
) and see which of the above files you have. Use cat filename
to list the contents of the files, and /bin/vi filename
to edit the file(s) to remove the offending line. If you haven't used vi
before, here are the key commands: You'll start in "command mode", which means you can move around, but can't type anything. Hit i (lowercase letter I) to enter "insert mode", move to where you want with the arrow keys, then put a #
symbol as the very first character on the offending line so it doesn't get executed the next time. When you're done editing, hit Esc, then :wq
to write the file to disk and quit. Keep in mind that the line may not be
/Applications/GRASS-6.4.app/Contents/MacOS/grass.sh'; exit
exactly, it may be something like /usr/local/bin/rungrass
or something similar.
After all this tomfoolery, close your bash
session, go back into the Preferences and change them back to what they were before, and hopefully you should be all set.
As a completely different way to fix this, move /Applications/GRASS-6.4.app
to some other location, like your Desktop, then you can use Terminal.app like normal to find and edit your startup files. Your choice :)