bash_profile Powerline setup - terminal

I am learning the command line and trying to customize my environment to have Powerline functionality.
I have installed the Powerline file from GitHub and am trying to add to my path variable.
My .bash_profile is set as follows:
export PATH=$PATH:$HOME/Library/Python/2.7/bin
export PATH=$PATH:$HOME/Library/Python/2.7/binpowerline-daemon -qPOWERLINE_BASH_CONTINUATION=1POWERLINE_BASH_SELECT=1. /Users/johnmyers/Library/Python/2.7/lib/python/site-packages/powerline/bindings/bash/powerline.sh
I receive the following error messages when launching terminal.
-bash: export: `-qPOWERLINE_BASH_CONTINUATION=1POWERLINE_BASH_SELECT=1': not a valid
identifier
-bash: export: `/Users/johnmyers/Library/Python/2.7/lib/python/site-packages/powerline/bindings/bash/powerline.sh':
not a valid identifier
I would appreciate any guidance in the right direction on this issue. Thank you.

The stuff you added needs to be broken up on individual lines with newlines between them. I can only guess where the newlines are supposed to go, but something like
export PATH=$PATH:$HOME/Library/Python/2.7/bin
# No need to repeat this
# export PATH=$PATH:$HOME/Library/Python/2.7/bin
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /Users/johnmyers/Library/Python/2.7/lib/python/site-packages/powerline/bindings/bash/powerline.sh

Related

not a valid identifier Mac OS Terminal returning an error every time I open it. Related to PATH variable?

the following comes up everytime I start a new terminal session.
-bash: export: `/usr/local/mysql/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/user1/opt/anaconda3/bin:/Users/user1/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/anaconda3/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier
then I am unable to use many commands or initiate a python session. cd command still works. I understand it may be related to the PATH variable and .bash_profile file? It started happening after unsuccessfully installing mysql (my os is not right version).
I am very new to all of this so any help would be amazing thank you!
Search and check the export instructions on your .bash_profile. You probably miss the variable assignation like that:
export PATH="${PATH}:...path to add..."
You'll probably find something like:
export "$PATH:..."
Which give you this error.

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.

Log: "bash: export: "PATH.": not a valid identifier" when opening terminal on Ubuntu

Whenever I open a terminal, a message appear on top of it saying what I wrote in the title.
I think I messed up with the /etc/profile file when trying to get maven work.
I read some infos on exporting variables, but couldn't find my error, since I followed a guide that worked fine for other people.
The profile file I mentioned has these lines at bottom:
JAVA_HOME=/usr/local/java/jdk1.8.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.8.0
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Setting $JAVA_HOME let me use properly Maven, but creates this annoying message. Can you help me?
As others mentioned in the comments, you are trying to export PATH. instead of PATH somewhere. You might want to check /etc/profile, ~/.bashrc and ~/.bash_profilefiles and try to find this invalid export.
The source you provided is technically ok and you don't need to add any $ signs. Your PATH will contain $HOME/bin value twice though. You might want to change it to look like this:
export JAVA_HOME=/usr/local/java/jdk1.8.0
export JRE_HOME=/usr/local/java/jre1.8.0
export PATH="$PATH:$HOME/bin:$JAVA_HOME/bin:$JRE_HOME/bin"

Terminal error in mac

I used to do something to change the looking my of macbook terminal(adding color to character, etc). However, since than, when ever I try "ls", it always gave the error like:
error : invalid character '' in LSCOLORS env var.
How to set up my env to fix it please?
Update: I fixed the problem by fix my .bash_profile in changing to
export LSCOLORS=ExFxCxDxBxegedabagacad
figure out your current setting - run 'grep "LSCOLORS=" ~/.bash_profile'
open your ~.bash_profile, find the LSCOLORS definition. Change it as follows:
export CLICOLOR=1
export LSCOLORS=Gxfxcxdxbxegedabagacad
You must have added a line beginning with LSCOLORS= some character to your .bash_profile. Open it in terminal with nano ~/.bash_profile or using TextEdit and remove that line.

Basic command lines on Mac terminal not working

I changed the bash profile while trying to install mongodb and none of my command lines are working on terminal. I read online that I need to fix the $PATH but I can't even access it when none of my commands are working.
Help?
Mistakenly I also ran into same problem where to resolve this I had to reset my PATH variable to basic settings as below :
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin"
Once you set PATH variable now you can open the .bash_profile file in same terminal session only and make changes accordingly. This will resolve your problem.
Ok I found the answer from here:
"Open Terminal, and go to File (or Shell) -> New Command. Type in open -e .profile (or substitute some other file instead of .profile), and hit Run. That should open TextEdit with the file you want to fix; you can remove the offending lines there."
in my case i typed in nano .bash_profile and that allowed me to edit my bash profile and fix the issue.
can't use terminal from error in .bash_profile
Run this in terminal:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Resources