Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Problem with Terminal

I don't sure what I did, but I have copied some codes from a site to terminal and "Setting up environment variables" was started to be written in terminal alwais! I don't know what does it mean but i really want to ger rid of it.. Please HELP!

Posted on Feb 5, 2012 9:40 AM

Reply
Question marked as Best reply

Posted on Feb 5, 2012 9:56 AM

Copying code from a site into terminal and executing it is always bad idea if you don't know what the code is doing. Hopefully there wasn't a sudo involved.


You'll need to copy what you pasted into terminal here and explain what you ere trying to do so we can see what was entered before being able to offer any advice.

6 replies
Question marked as Best reply

Feb 5, 2012 9:56 AM in response to tomer187

Copying code from a site into terminal and executing it is always bad idea if you don't know what the code is doing. Hopefully there wasn't a sudo involved.


You'll need to copy what you pasted into terminal here and explain what you ere trying to do so we can see what was entered before being able to offer any advice.

Feb 7, 2012 3:41 PM in response to tomer187

I am assuming you had (or have) some shell variables defined in one or more of the bash (I am also you are using that shell) startup files (~/.bash_profile, ~/.bash_login, ~/.profile, ~/.bashrc). If you want everything to reset to the defaults remove those files if they are present.


You should have the bash reference manual handy and look at the meaning of those startup files (section 6.2 Bash Startup Files).


I'm guessing you probably had PS1 defined to change the default appearance of the shell prompt. Search for PS1 in the bash reference manual.

Feb 7, 2012 6:50 PM in response to tomer187

Listen to Frank Caggiano and X423424X. But to help you along the way use


/bin/ls -a


to see all the file with leading dots (periods) such as the .profile, .bash_profile, .bash_login, and/or .bashrc


Use


/bin/rm .profile .bash_profile .bash_login .bashrc


to remove any of these files if you have them.


If you have not created any of these files and they do not contain the problems affecting your Terminal session, you should post the errors you are seeing (copy and paste), as well as a description of what problems you are seeing.

Feb 8, 2012 5:07 AM in response to BobHarris

In place of the remove (rm) deletion suggested by BobHarris, I'd save off copies, so that you can learn more about what went wrong...

/bin/mv .profile profile_bad

/bin/mv .bash_profile bash_profile_bad

/bin/mv .bash_login bash_login_bad

/bin/mv .bashrc bashrc_bad


Mistakes can be educational.


And one last detail; if you are going to do this, copy the URL or the source into the file as a comment. Something as simple as the following bash comment:


# got this code from www.example.com

Feb 8, 2012 5:36 AM in response to tomer187

Definitely follow the ideas of the other posters here, all very good ideas from knowledge people.


Just want to add two things. First while reinstalling is always an option in this case it may not fix your problem. The changes you made were most likely done to your user environment so if you re-install the OS and not also wipe your account chances are the problem will still be there. If you had a backup of the system from before you did what you did you could go to that.


Second if you could post a screen shot of your terminal window we might get a better idea of just what you did and how to fix it (if anything needs fixing)


regards

Problem with Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.