-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

User uploaded file

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

Bash Version:.

User uploaded file

MacBook Pro, macOS Sierra (10.12), Terminal

Posted on Sep 28, 2016 6:37 PM

Reply
2 replies

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

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

User uploaded file

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.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.