terminal mac - bash command not found, permission denied and '&gt' in prompt - bash

I tried to change colors in terminal following this guide:
http://osxdaily.com/2013/02/05/improve-terminal-appearance-mac-os-x/
I created bash_profile file, saved and quit terminal. Now when I open the terminal I get this:
Last login: Mon Oct 17 01:36:24 on ttys000
-bash:  : command not found
-bash:  : command not found
-bash:    git: command not found
-bash: gt: command not found
-bash: /dev/null: Permission denied
->> $ this last line is changed on stackoverflow. I do not understand why. Please look at the photo below.
I deleted bash_profile and I still get the same.

I did not use the flag asking for moving the post as suggested in the comment because I had already posted the same post on AskDifferent.
The answer to the problem is on AskDifferent:
https://apple.stackexchange.com/questions/257603/terminal-change-of-colours-guide-file-bash-profile-bash-not-found-permissi
The problem with a syntax error is caused by HTML markup in the source I copy/pasted this from.

Related

Terminal opening on MacBook Pro gives bash location issue

When I open my terminal on MacBook Pro I get the below message, but command line seems work fine after this, but I would like to correct this message coming up. MESSAGE:
-bash: occur: command not found
-bash: ----Beginning: command not found
-bash: is: command not found
-bash: other: command not found

Terminal modified permanently by vscode

I installed vscode today and followed the steps on tutorials on youtube to set up. My terminal started to act weird after I called python through the terminal and tried to use pip install command but failed. I uninstalled the app, deleted all the relevant files, and tried to reopen the terminal. The terminal still has the same warnings.
I have contacted Apple Tech support and they say my terminal got modified by the app. They asked me to contact the app developer.
I don't know what I did to get where I am now. I would appreciate any help that can bring my terminal back to normal.
Below are the warnings even after I uninstalled the app:
Last login: Wed Jun 10 23:02:45 on ttys000
You have mail.
-bash: Saving: command not found
-bash: ...copying: command not found
-bash: ...saving: command not found
-bash: ...completed.: command not found
-bash: Deleting: command not found
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
ZhouChristinas-MacBook-Pro:~ zhouchristina$
Check your shell's startup script, it looks like you have text there that aren't shell commands. I don't know whether you have bash or zsh as your shell, but check all of these files just to be sure:
~/.bashrc
~/.bash_aliases
~/.bash_profile
~/.bash_login
~/.zshrc
~/.zshenv
~/.zprofile
~/.zlogin
~/.profile
Also look into any files that are sourced by these files.

Error message is shown when opening the terminal (bash) in the Mac

I used to install mysql in my mac. Now I have forgotten details about installation.
But after installing mysql, the error message will be shown in my bash when I open the terminal in my Mac. (See the details below)
Last login: Tue Jan 7 21:19:26 on ttys000
-bash: export: `=': not a valid identifier
-bash: export: `/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin': not a valid identifier
I doubt whether the error is related with the environment variable.However, I checked the $PATH, it seems normal.
jake ~ $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Any one can help me fix this problem ?
Many thanks !
You have in either .bashr_profile or .bashrc an expoert statement, where there is a space between the variable and the equal sign.

Why when I open terminal do I see the following:

Last login: Mon Jun 17 10:41:49 on ttys000
-bash: export: `2019.03': not a valid identifier
XXX:~ YYY$
(Note the XXXs and YYYs are just replacement)
Specifically, I am talking about the
-bash: export: `2019.03': not a valid identifier
I just installed Anaconda on Mac and then tried to update it and did in it incorrectly and now when I open the terminal, this appears every time. I know that 2019.03 is the current version of Anaconda and I have since fixed Anaconda so that my version is currently that version but I do not know what this "not a valid identifier" this is. Any help with how to address what it is, why it is there, and how I can remove it would be much appreciated.
EDIT: Thanks for assistance. I opened the bash profile and some of the comments was in the same line as the export path line and that was messing it up. Thank you!
If you open the terminal and see that there is some error coming from ~bash, it likely has something to do with the bash profile. You should open that up and check to make sure that nothing is out of place like having more than one thing on the same line since it can be sensitive to that.
You see the following due to the anaconda3 2019.03 installer trying to export a non valid identifier from your .bash_profile file. Note, this file is usually hidden due to the period in front of the file name.
The following is what was appearing in my terminal:
-bash: export: `2019.03': not a valid identifier
Do the following to fix this issue.
$ nano .bash_profile
Now you should be inside of the .bash_profile file using the nano editor.
# comment out or remove the following line from .bash_profile
# then save before you exit the file
#export PATH="MAMP_PHP:$PATH"# added by Anaconda3 2019.03 installer
Close your terminal and open it again, and the annoying "-bash: export: `2019.03': not a valid identifier" should be gone whenever you open a new terminal.

I don't know what happened in terminal

I have some problem and I don't know at all... Here is my shell.
Last login: Tue Jun 6 20:20:15 on ttys000
-bash: home/username/programs/apache-maven-3.5.0/bin:/usr/local/bin:/usr/bin:/bi
n:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Ver
sions/Current/Commands: No such file or directory
-bash: uname: command not found
-bash: ps: command not found
-bash: touch: command not found
I already googling but I can't find answer... what is this problem and how can I fix it?
It look like your PATH environment variable setting wrong value.
change home/username/programs/apache-maven-3.5.0/bin to /home/username/programs/apache-maven-3.5.0/bin
or just to deleted it

Resources