General Question

tobytobsen's avatar

How to fix my Mac Terminal?

Asked by tobytobsen (27points) January 31st, 2008

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

10 Answers

Evert's avatar

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.

tobytobsen's avatar

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..)

Evert's avatar

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)

jrpowell's avatar

Use Tinkertool http://bresink.de/osx/0TinkerTool/download.html

That has a option to make invisible files visible in the Finder. Select “Show Hidden and System Files”

Evert's avatar

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

tobytobsen's avatar

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

jrpowell's avatar

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.

tobytobsen's avatar

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

tobytobsen's avatar

yay! it worked, there was crap in the .bash_profile Thank y’all so much!

ananas's avatar

I have a similar issue…I installed Soylatte a looong time ago and i think I didn’t finish it proprerly or something and now I’m afraid I’ve messed up the path since all the commands i try come back as ‘command not found’. This is what I get:

Tietokone-Anna-Sillanp-2:~ annasillanpaa$ echo $PATH
/Users/annasillanpaa/Documents/soylatte16–1.0.2/bin
Tietokone-Anna-Sillanp-2:~ annasillanpaa$ export
declare -x HOME=”/Users/annasillanpaa”
declare -x LOGNAME=“annasillanpaa”
declare -x OLDPWD
declare -x PATH=”/Users/annasillanpaa/Documents/soylatte16–1.0.2/bin”
declare -x PWD=”/Users/annasillanpaa”
declare -x SECURITYSESSIONID=“c9ccc0”
declare -x SHELL=”/bin/bash”
declare -x SHLVL=“1”
declare -x TERM=“xterm-color”
declare -x TERM_PROGRAM=“Apple_Terminal”
declare -x TERM_PROGRAM_VERSION=“133–1”
declare -x USER=“annasillanpaa”
declare -x __CF_USER_TEXT_ENCODING=“0×1F5:0:17”
Tietokone-Anna-Sillanp-2:~ annasillanpaa$ sudo -s
-bash: sudo: command not found

And it’s not just sudo, i put it there as and example, pretty much any command i try won’t work. I haven’t used terminal that much so I’m kind of clueless here I would really appreaciate it if anyone can help me on this.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther