The problem likely is with one of the three following files all located at the root of your home directory: .bashrc, .profile, or .bash_profile. Try this:
1) While in an sh session, navigate to your home directory if you are not already there (type in cd ~).
2) Run the command ls -al and determine which of those files (.bashrc, .profile, or .bash_profile) are present in your home folder.
3) It is likely the file which is causing the problem is the last one you were editing or is linked to by one of the three previously named files. Either move or change the file name of one of those files in of your home directory. If you are not sure which file you were working with, I would start with .bashrc.
Example command to move .bashrc: mv .bashrc bashrc.bak
4) Once you have moved or changed the file name of one of the previously listed files, try opening a new bash session. If the session launches successfully, then you know which file needs to be edited further. If the bash session does not launch, restore the file back to its original location. If no one file appears to be the cause, try moving or changing the file names of all named files.
5) Make a backup of the file which is causing problems.
To resolve the "process completed" message, you will need to troubleshoot the script looking for return or exit statements which may be written incorrectly. If those are not present, you may have to go the route of commenting lines of the script out to determine where the problem is. To comment a line out, add a # character to the beginning of the line.
During this last step, you will need to move a copy of the offending file back to its original location. To make things easier, I would probably open the file using TextWrangler or from nano or vim in another sh session to make changes.
(Note: TextEdit and XCode will also work. However, to open the file, you will need to issue a command such as "open -a TextEdit.app ~/.bashrc" to open the file because the Open File Window does not allow for opening files whose names start with a period.)
$PATH should contain these folders: /usr/bin:/usr/sbin:/bin:/sbin
.
Try editing ~/.bash_profile
, ~/.profile
, or ~/.bash_login
(with for example /usr/bin/open ~/.bash_profile -a TextEdit
) and commenting out any lines that modify the path.
If that works, you can add a line like export PATH=/opt/local/bin:/opt/local/sbin:$PATH
to ~/.bash_profile
.
Best Answer
Try typing
ls -G
in terminal, you should see colored listings by file type. If the scripts aren't being shown in a different color, this means that they are not marked as executable, so you will need to typesudo chmod +x <filename>
to make them so. Then they should appear in a different color as opposed to directorys etc.If you prefer not to always type ls -G then you can put the following command in your
.bashrc
file in your home directoryalias "ls"="ls -G"
Then restart terminal and you should see colored output whenever you just typels