How to fix my Mac Terminal?
I recently was changing something in my Terminal settings, and then forget about that… it was something with LaTex, maybe for bobtex or so. Now my terminal does not work anymore, i cant run any program. It looks like this:
-bash: export: `thesis/web/www/website3local/cake/console/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin’: not a valid identifier
localhost:~ toby$ ls
-bash: ls: command not found
localhost:~ toby$ python
-bash: python: command not found
localhost:~ toby$
I dont know what to do – Anyone has a clue?
Observing members:
0
Composing members:
0
Answers
Looks like you messed up your PATH (export is a shell builtin).
If it’s not in your .profile or .bashrc or so, quitting your current terminal and opening a new one should work.
Otherwise, first try is to edit those files, or more simply make a copy of them and then remove the original ones. Start up a new terminal and see if that works: it should get the default system PATH. If it doesn’t, your system startup file may have been messed up (which would be very odd).
I’ll need some more diagnostics if I want to help you further.
Thanks for your answer, yes, it was the PATH. The problem is that i cannot acces the hidden dot files (access would be possible after a command in the shell, which is not working :( ) Is there any way to open the .files without “seeing” then in finder? (Cant use terminal for that..)
yes, you can use the terminal: issue the full path. Eg, if you know how to use ‘emacs’ from shell, use
cd ~
/usr/bin/emacs .profile
Or otherwise something like
cd ~
/usr/bin/open -a TextEdit .profile
(note: cd is a shell built-in command)
Of course, all tools like Tinkertool do is something like explained at http://www.osxfaq.com/DailyTips/02–2005/02–01.ws (it probably even has proper Apple documentation).
In case one doesn’t like to overload his/her Mac with 3rd party stuff.
(And to use such a command on the command line with a non-path, use
/usr/bin/defaults write com.apple.finder AppleShowAllFiles TRUE
and then
/usr/bin/killall Finder
)
But if you’re hacking around with .-files, one should feel comfortable enough in the shell in the first place to execute /usr/bin/open -a TextEdit ~/.profile
Text edit didn’t work, trying the tinkertool now
-bash: export: `thesis/web/www/website3local/cake/console/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin’: not a valid identifier
localhost:~ toby$ cd ~
localhost:~ toby$ /usr/bin/open -a TextEdit .profile
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/MAMP/Library/lib/libJPEG.dylib
Trace/BPT trap
localhost:~ toby$ /usr/bin/open -a TextEdit ~/.profile
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/MAMP/Library/lib/libJPEG.dylib
Trace/BPT trap
localhost:~ toby$ /usr/bin/defaults write com.apple.finder AppleShowAllFiles TRUE
localhost:~ toby$ /usr/bin/open -a TextEdit ~/.profile
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/MAMP/Library/lib/libJPEG.dylib
Trace/BPT trap
I was under the impression that his Terminal.app was hosed.
And Tinkertool issues the command you listed. It is simply a GUI for stuff already in the Terminal. It doesn’t even ask for a password.
ok, i can see now my .files, here is whats in .profile:
#
# Your previous .profile (if any) is saved as .profile.mpsaved
# Setting the path for MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
yay! it worked, there was crap in the .bash_profile Thank y’all so much!
Answer this question 