Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
Hi, all

I accidentally set the PATH in bash shell as
export PATH=(/usr/local/bin:$PATH)

I knew that's wrong syntax cause the braces :(

Anyone can tell me how to fix it? Thanks!
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
I set it in Terminal-----bash shell, not in the .profile.

And since I can not start up terminal, so I don't know how to use the command line to set the PATH correctly
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
thank you very much, Cromulent

I just download Text Wrangler, can u tell me where to find the configure file to change the PATH back?
 

enberg

macrumors regular
Jan 13, 2010
204
0
If you typed that into the bash command-line, it should just go away when you close that terminal.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,424
A sea of green
Starting from your home folder:

1. Open the Library folder.

2. Open the sub-folder Preferences.

3. Locate the file named: com.apple.Terminal.plist.

4. Drag it to the Trash.

5. Relaunch Terminal.app.

If it still doesn't work, then you will have to be more specific about exactly what you changed when you wrote:
I accidentally set the PATH in bash shell as
export PATH=(/usr/local/bin:$PATH)

Did you edit this into a file? If so, exactly which file?
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
I tried this before, it doesn't work.:(

What I did is:
1. launch the terminal (the default shell is bash, I use leopard, I didn't change any configuration of terminal or bash before)

2. since I install a new version of tcl in /usr/local/bin, so I type in
export PATH=(/usr/local/bin:$PATH)

3. after that the Terminal doesn't work, all I can get is a blank window with the title 'Terminal----login"

BTW, I use Finder to search for the invisible file named .bash_profile or .profile on my computer. nothing shows up.

Any suggestions?



Starting from your home folder:

1. Open the Library folder.

2. Open the sub-folder Preferences.

3. Locate the file named: com.apple.Terminal.plist.

4. Drag it to the Trash.

5. Relaunch Terminal.app.

If it still doesn't work, then you will have to be more specific about exactly what you changed when you wrote:


Did you edit this into a file? If so, exactly which file?
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
BTW, I use Finder to search for the invisible file named .bash_profile or .profile on my computer. nothing shows up.

Finder won't find hidden files by default. Do you have hidden files enabled in Finder. TinkerTool can enable hidden files (among other things).

Can you type in anything in Terminal, even though there's nothing on-screen? If so, you can use commands by giving their full path e.g, /usr/bin/ls.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,424
A sea of green
1. Quit Terminal.app

2. Relaunch Terminal.app.

3. Doing nothing else, and without entering any commands, take a screenshot of any Terminal window or windows, and post the image here.


4. From Terminal's Shell menu, choose New Command...

5. Copy and paste the following text into the text-entry field:
Code:
printenv; ls -la ~

6. Check the "Run command inside a shell" checkbox.

7. Click Run.

8. Copy and paste the entire output of the Terminal window into a post.


I'm running Leopard, and I entered your erroneous command into a Terminal window. It caused no lasting harm or damage. When I open another Terminal window, or quit and relaunch, it all works fine.
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
I enabled Finder to search invisible files as the following

Finder-->File menu(choose Find)-->Kind(choose other)-->choose invisible file-->invisible item

In this way I can find .bash_history, which has the exact record I used before. but there is no .bash_profile or .profile/

Yeah, I can type in the Terminal, but nothing happens. it just like typing in the TextEdit. It doesn't respond to any command at all.


Finder won't find hidden files by default. Do you have hidden files enabled in Finder. TinkerTool can enable hidden files (among other things).

Can you type in anything in Terminal, even though there's nothing on-screen? If so, you can use commands by giving their full path e.g, /usr/bin/ls.
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
I don't know what's going on :(. except that command, I tried nothing new in the terminal. So I don't know what really causes the problem. And I change to Administrator account to launch the Terminal. The same thing happened.

Here is the screenshot before I run the new command
346p5w9.png


And here is the after one
1zw2cck.png


It seems nothing happened. All blank.....


1. Quit Terminal.app

2. Relaunch Terminal.app.

3. Doing nothing else, and without entering any commands, take a screenshot of any Terminal window or windows, and post the image here.


4. From Terminal's Shell menu, choose New Command...

5. Copy and paste the following text into the text-entry field:
Code:
printenv; ls -la ~

6. Check the "Run command inside a shell" checkbox.

7. Click Run.

8. Copy and paste the entire output of the Terminal window into a post.


I'm running Leopard, and I entered your erroneous command into a Terminal window. It caused no lasting harm or damage. When I open another Terminal window, or quit and relaunch, it all works fine.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,424
A sea of green
The Terminal window appears to be running the login command.

1. Close all Terminal windows.

2. Choose Preferences... from the Terminal menu.

3. Click the Startup icon in the toolbar.

4. In the lower part, "Shells open with", choose the "command (complete path)" radio button, then make sure the contents of the text box is exactly this:
Code:
/bin/bash

5. Close the Preferences window.

6. Choose the menu item: Shell > New Window > Basic

7. Make another screenshot and post it.
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
I did what u mentioned. It seems nothing changed. Still the same.

28atb3b.png




The Terminal window appears to be running the login command.

1. Close all Terminal windows.

2. Choose Preferences... from the Terminal menu.

3. Click the Startup icon in the toolbar.

4. In the lower part, "Shells open with", choose the "command (complete path)" radio button, then make sure the contents of the text box is exactly this:
Code:
/bin/bash

5. Close the Preferences window.

6. Choose the menu item: Shell > New Window > Basic

7. Make another screenshot and post it.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,424
A sea of green
Then you may have somehow damaged more than you thought, although I have no idea how.

I'm completely baffled, partly because whatever you did is affecting multiple accounts, so it's a pretty significant change, whatever it is.

If you have a Time Machine backup, I suggest reverting your system to a point in time before you started messing around in Terminal.

If you don't have a backup, consider doing an Archive and Install of your bootable OS DVD. This will preserve account and network settings, but reinstall all the OS files, including apps and command-line utilities.

Or you can wait and see if someone else has any other ideas.

If I think of anything else, I'll post, but right now, I'm completely stumped.
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
Sorry to baffle you .... :eek:

I'm frustrated .... it's so weird. I definitely will back up my laptop next time before I try anything new.

Anyhow, thank you so much for all the help.



Then you may have somehow damaged more than you thought, although I have no idea how.

I'm completely baffled, partly because whatever you did is affecting multiple accounts, so it's a pretty significant change, whatever it is.

If you have a Time Machine backup, I suggest reverting your system to a point in time before you started messing around in Terminal.

If you don't have a backup, consider doing an Archive and Install of your bootable OS DVD. This will preserve account and network settings, but reinstall all the OS files, including apps and command-line utilities.

Or you can wait and see if someone else has any other ideas.

If I think of anything else, I'll post, but right now, I'm completely stumped.
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
Hi, chown33

I just remembered that I do have back up by using Time Machine around one month ago. I never used Time Machine to restore any application before.

Could u tell me if I just want to restore the Terminal, what I should do?
 

Sander

macrumors 6502a
Apr 24, 2008
521
67
2. since I install a new version of tcl in /usr/local/bin, so I type in
export PATH=(/usr/local/bin:$PATH)

3. after that the Terminal doesn't work, all I can get is a blank window with the title 'Terminal----login"

Are you sure it was the "export" which broke your Terminal, and not the "install a new version of tcl"?
 

Mac Player

macrumors regular
Jan 19, 2006
225
0
Check /etc/paths and all files under /etc/paths.d/ also check if you have a file ~/.MacOSX/environment.plist
 

carolyn.lee

macrumors newbie
Original poster
Feb 20, 2008
17
0
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.