Terminal crash

Discussion in 'Mac Programming' started by carolyn.lee, Feb 7, 2010.

  1. carolyn.lee macrumors newbie

    Joined:
    Feb 20, 2008
    #1
    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!
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Where did you set it, preferences, .profile, .bash_profile, etc.?
     
  3. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #3
    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
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    Just open up the file with a standard Mac OS X text editor (Text Wrangler shows hidden files) and change it back / correct it.
     
  5. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #5
    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?
     
  6. enberg macrumors regular

    Joined:
    Jan 13, 2010
    #6
    If you typed that into the bash command-line, it should just go away when you close that terminal.
     
  7. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #7
    I reinstall the terminal. it still doesn't work.
     
  8. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #8
    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?
     
  9. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #9
    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?



     
  10. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #10
    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.
     
  11. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #11
    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.
     
  12. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #12
    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.


     
  13. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #13
    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
    [​IMG]

    And here is the after one
    [​IMG]

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


     
  14. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #14
    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.
     
  15. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #15
    I did what u mentioned. It seems nothing changed. Still the same.

    [​IMG]



     
  16. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #16
    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.
     
  17. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #17
    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.



     
  18. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #18
    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?
     
  19. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #19
    You already reinstalled Terminal, according to post #7:
    Restoring it from Time Machine won't be any different.
     
  20. Sander macrumors 6502

    Joined:
    Apr 24, 2008
    #20
    Are you sure it was the "export" which broke your Terminal, and not the "install a new version of tcl"?
     
  21. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #21
    Check /etc/paths and all files under /etc/paths.d/ also check if you have a file ~/.MacOSX/environment.plist
     
  22. carolyn.lee thread starter macrumors newbie

    Joined:
    Feb 20, 2008
    #22

Share This Page