Leandro Igor

Q: -bash 'export: command not found | What to do?

Every time I boot the terminal get this:

 

What to do? when you get this message when starting the terminal:

What do I do to not leave this? Please, Thanks.

 

-bash 'export: command not found

Captura de pantalla 2016-09-28 a las 20.34.02.png

-------------------------------------------------------------------------------- ---------------------

Bash Version:.

Captura de pantalla 2016-09-28 a las 20.34.46.png

MacBook Pro, macOS Sierra (10.12), Terminal

Posted on Sep 28, 2016 6:37 PM

Close

Q: -bash 'export: command not found | What to do?

  • All replies
  • Helpful answers

  • by BobHarris,

    BobHarris BobHarris Sep 28, 2016 7:40 PM in response to Leandro Igor
    Level 6 (19,672 points)
    Mac OS X
    Sep 28, 2016 7:40 PM in response to Leandro Igor

    I think there is a smart-quote character at the beginning of the export command, that bash thinks is part of the command name.

     

    that is to say

    export xyz=something

    is not the same as

    ´export xyz=somthing

    bash knows about ' (single quote) and " (double quote), but the smart-quote is NOT part of the bash special character syntax, so it is just treated as part of the white space separated word ´export, which bash then checks against the bash built-in command list, and if not found there, it looks for a file with the name ´export in each of the directories specified in the PATH environment variable, and bash did not find ´export anywhere, so it issued the

    -bash: ´export: command not found

    message

  • by BobHarris,

    BobHarris BobHarris Sep 28, 2016 7:47 PM in response to BobHarris
    Level 6 (19,672 points)
    Mac OS X
    Sep 28, 2016 7:47 PM in response to BobHarris

    Sorry, I hit "Reply" too soon.  Continuing...

     

    You need to look in the bash shell initialization file and correct the command by removing that ´ character from the front of the export command.  Suggest using TextWrangler as your editor, as it will not mess with the file in unexpected ways

    <http://www.barebones.com/products/textwrangler/>
    TextWrangler is free

     

    Bash can use any of the following named files as an initialization file.

    .bash_profile

    .bash_login

    .profile

    .bashrc

    By default, none of these files exist, so chances are you will only find one of them (guessing it will be .profile, but it could be one of the others)

     

    When using TextWrangler make sure you tell it to

    Screen Shot 2016-09-28 at 10.44.50 PM.png

    Show hidden items (the above image is from the open dialog box.

     

    If you want any additional help editing the bash initialization file, feel free to post the contents of the file as a reply and let us know how we can help.