I broke the Terminal app.

Discussion in 'Mac Programming' started by Morgan Stack, Jan 5, 2016.

  1. Morgan Stack macrumors member

    Joined:
    Jul 24, 2011
    #1
    Hello,

    I'm not that familiar with using the Terminal, but every now and then I mess around with the command-line to make some adjustments to the computer. A few months ago, I began noticing typing some commands (like 'sudo') into the Terminal stopped working. Now, whenever I open Terminal, a heading of text appears:

    export: `Archiver/B1FreeArchiver.app/Contents/MacOS:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin': not a valid identifier​

    I have no idea what this means. I downloaded B1 Free Archiver sometime a few months ago, that seems to be the problem.

    Anyway, the text is clutter, and I'm not sure how to get rid of it. Some commands don't seem to work anymore, and that's a real problem. Is there a method you can explain to me clearly that will reset the Terminal app to it's default state? I don't wish to do a clean install of the operating system.
     

    Attached Files:

  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
  3. Morgan Stack thread starter macrumors member

    Joined:
    Jul 24, 2011
    #3
    The operating system is 10.9.5.
    Typing in the command correctly, the response is;
    Code:
    -bash: ls: command not found
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    Thanks, that was informative.

    Try this, again pasting the complete output inside CODE tags:
    Code:
    /bin/ls -la ~
     
  5. 556fmjoe macrumors 65816

    Joined:
    Apr 19, 2014
    #5
    Sounds like your PATH is messed up. Post the output of this command

    Code:
    /bin/echo $PATH
    edit: nevermind, I didn't read the OP thoroughly. Looks like your $PATH is in the output and the new archiver added a line to it. Delete that line from $PATH and see what happens
     
  6. Morgan Stack thread starter macrumors member

    Joined:
    Jul 24, 2011
    #6
    Code:
    total 112
    drwxr-xr-x+ 51 morganstack  staff  1734  5 Jan 13:34 .
    drwxr-xr-x  5 root  admin  170 16 Dec  2014 ..
    -rw-------  1 morganstack  staff  3 16 Dec  2014 .CFUserTextEncoding
    -rw-r--r--@  1 morganstack  staff  24580  5 Jan 15:46 .DS_Store
    drwx------  2 morganstack  staff  68  5 Jan 19:29 .Trash
    -rw-------  1 morganstack  staff  8938  5 Jan 21:45 .bash_history
    -rw-r--r--  1 morganstack  staff  249  8 Sep 20:47 .bash_profile
    drwxr-xr-x  4 morganstack  staff  136 16 Dec  2014 .cache
    drwxr-xr-x  6 morganstack  staff  204 14 Nov 16:27 .config
    drwxr-xr-x  32 morganstack  staff  1088  8 Jan  2015 .fontconfig
    drwx------  3 morganstack  staff  102  8 Jan  2015 .gconf
    drwx------  3 morganstack  staff  102  8 Jan  2015 .gconfd
    drwxr-xr-x  3 morganstack  staff  102  8 Jan  2015 .gnome2
    drwx------  12 morganstack  staff  408  5 Jan 11:30 .gnupg
    drwxr-xr-x  5 morganstack  staff  170  7 Nov 02:33 .idlerc
    drwxr-xr-x  3 morganstack  staff  102 16 Dec  2014 .local
    drwxr-xr-x  3 morganstack  staff  102 17 Dec  2014 .mplayer
    -rw-------  1 morganstack  staff  40  6 Sep 16:29 .python_history
    -rw-------  1 morganstack  staff  1024 11 Jul 04:55 .rnd
    drwxr-xr-x  3 morganstack  staff  102 30 Sep 19:53 .swt
    drwxr-xr-x  4 morganstack  staff  136  7 Aug 16:02 .thumbnails
    -rw-r--r--  1 morganstack  staff  982  8 Jan  2015 .xinitrc
    Code:
    /Applications/File
    Can you be more clear about what you want me to do please?
     
  7. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #7
    OK, now do the following:

    1. Paste this command into Terminal:
    Code:
    /bin/mv ~/.bash_profile ~/broken_profile.txt
    2. Quit Terminal.

    3. Relaunch Terminal.
    Confirm that the error message no longer appears, and the following command works:
    Code:
    ls -la ~
    4. If the command works, then open "broken_profile.txt" in TextEdit, and copy and paste its entire contents here, inside CODE tags.

    After seeing the contents of the broken profile, I can tell you how to make a corrected version of that file. I'm pretty sure I know what the erroneous line will be, but I need to see the rest of the file in order to provide a complete correct profile.
     
  8. Morgan Stack thread starter macrumors member

    Joined:
    Jul 24, 2011
    #8
    So far, so good.

    Code:
    
    # Setting PATH for Python 3.4
    # The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
    export PATH
    
    export PATH=/Applications/File Archiver/B1FreeArchiver.app/Contents/MacOS:$PATH
    
     
  9. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #9
    Do you care about/want the B1 Archiver? I would just nix the last line of .broken_profile and change its name back to .bash_profile.
     
  10. Morgan Stack thread starter macrumors member

    Joined:
    Jul 24, 2011
    #10
    No I have no more use for the application.
     
  11. 556fmjoe macrumors 65816

    Joined:
    Apr 19, 2014
    #11
    I would do what @ArtOfWarfare suggests then. The problem is that the last line has a space in it, which means it gets cut off after "File". This sets your $PATH variable to just "/Applications/File" which doesn't exist.
     
  12. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #12
    Additionally, PATH is defined twice so that's also confusing matters. But yes, deleting that last line and moving the profile back will solve the problem.
     
  13. Morgan Stack thread starter macrumors member

    Joined:
    Jul 24, 2011
    #13
    I appreciate guiding me through the solution. Thanks.
     

Share This Page