Strange message in Terminal.

Discussion in 'macOS' started by ThatWasAwkward, Jun 19, 2009.

  1. ThatWasAwkward macrumors member


    Jan 23, 2006
    Every time I start Terminal, it says the following before the prompt and after the "last login":

    "-bash: export: `PATH#': not a valid identifier"

    It ALWAYS says this. I assume this is symptomatic of a slight behind-the-scenes code issue that I could easily fix if I could figure out what it is. Anyone have any idea?
  2. angelwatt Moderator emeritus


    Aug 16, 2005
    When opening Terminal it reads a couple hidden files that sometimes have extra commands setup in them. It sounds like one of those files has a typo. Hard to say if you added the line causing the problem or an application. The files it could be in are .profile and .bash_profile generally. These will be in your home directory, which is where you'll start at when you open Terminal. To quickly see the contents of those files do,

    cat .profile
    cat .bash_profile
    If one of those files doesn't exist it'll tell you. Neither exist by default. If you can see the offending line that resembles what the error message gave then you know where to make the fix. To edit the file you can use the pico editor or type in,
    open .profile
    and it'll open in TextEdit. I think that's the syntax anyways. I'm not at my Mac currently.

    If you need help post the lines that you see and we'll try to help, or you can add a # to the start of the line and that will comment out the line so it doesn't try to run. I don't know if not having it will cause any issues for any installed apps, though since it's not written correctly currently that doesn't matter much.
  3. ThatWasAwkward thread starter macrumors member


    Jan 23, 2006
    Well, turns out it was a line in .profile after all. I've fixed it, and no more error message. Thanks!

Share This Page