Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > -bash: export: `/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier

-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier
Thread Tools
MacPC
Forum Regular
Join Date: Aug 2006
Status: Offline
Reply With Quote
Feb 24, 2007, 12:30 PM
 
Hi,

Everytime I open the terminal, under Welcome to Darwin, I got this message-
-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier

Everything seems to be working fine. But how the hell can I get rid of it. It's driving me CRAZY! :0

I use OSX 10.4.8 on a G4 Mac mini.

Thanks in advance.

MacPC.
     
Mithras
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Feb 24, 2007, 01:04 PM
 
Do this, would you?
cat ~/.bashrc

and paste the contents here? Seems like you have a messed-up line in your .bashrc (or possibly .profile or .bash_profile.
     
MacPC  (op)
Forum Regular
Join Date: Aug 2006
Status: Offline
Reply With Quote
Feb 25, 2007, 12:46 AM
 
Hi,

Thanks.


I did cat ~/.bashrc, it came up nothing.

I was looking through all the bash related files,
In the /etc/bashrc, I have:
# System-wide .bashrc file for interactive bash(1) shells.
if [ -n "$PS1" ]; then PS1='\hw \u\$ '; fi
# Make bash check it's window size after a process completes
shopt -s checkwinsize

Not sure what this does.

In my /etc/profile I have:
# System-wide .profile for sh(1)
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc

Not sure what this does either.
I think the error msg has to do with one of the above files.

In my ~/.bashrc I have:
export PATH=/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/Developer/Tools: $PATH
and in my ~/.bash_profile I have
export PATH=/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/Developer/Tools: $PATH
same as ~/.bashrc.

There is also a .bash_history in the /Users?myusername/ but it's blank.

Do they look normal?

MacPC.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 25, 2007, 01:43 AM
 
Remove the space right before $PATH in your ~/.bashrc and ~/.bash_profile
     
MacPC  (op)
Forum Regular
Join Date: Aug 2006
Status: Offline
Reply With Quote
Feb 27, 2007, 12:46 AM
 
Thanks so much besson3c. After I removed the space, the error message is gone!

MacPC
     
kriztyke
Fresh-Faced Recruit
Join Date: Apr 2008
Status: Offline
Reply With Quote
Apr 10, 2008, 06:15 PM
 
I dont remember it printing "not a valid identifier".

I have the original /etc bashrc and profile files,

$ export
declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin"
$ export $PATH
-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier

I try to add a homepath .profile file including,

PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/X11R6/bin
export PATH

$ export
declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin:/Users/user/bin:/usr/local/bin:/usr/X11R6/bin"
$ export $PATH
bash: export: `/usr/bin:/bin:/usr/sbin:/sbin:/Users/user/bin:/usr/local/bin:/usr/X11R6/bin': not a valid identifier
( Last edited by kriztyke; Apr 10, 2008 at 06:32 PM. )
     
Cold Warrior
Moderator
Join Date: Jan 2001
Location: Polwaristan
Status: Offline
Reply With Quote
Apr 10, 2008, 06:26 PM
 
Don't email. Just post here so we can all benefit.
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Apr 11, 2008, 12:42 PM
 
Originally Posted by kriztyke View Post
I dont remember it printing "not a valid identifier".

I have the original /etc bashrc and profile files,

$ export
declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin"
$ export $PATH
-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier

I try to add a homepath .profile file including,

PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/X11R6/bin
export PATH

$ export
declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin:/Users/user/bin:/usr/local/bin:/usr/X11R6/bin"
$ export $PATH
bash: export: `/usr/bin:/bin:/usr/sbin:/sbin:/Users/user/bin:/usr/local/bin:/usr/X11R6/bin': not a valid identifier
We don't:
export $PATH

Rather... we:
export PATH
-HI-
     
kriztyke
Fresh-Faced Recruit
Join Date: Apr 2008
Status: Offline
Reply With Quote
Apr 14, 2008, 08:21 PM
 
That doesnt print anything, I want the declare printed.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 14, 2008, 08:31 PM
 
So add declare -p PATH?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
kriztyke
Fresh-Faced Recruit
Join Date: Apr 2008
Status: Offline
Reply With Quote
Apr 20, 2008, 01:45 PM
 
I just wondered: is it normal to get that print running bash export $PATH or is something failing?
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Apr 20, 2008, 04:52 PM
 
Originally Posted by kriztyke View Post
I just wondered: is it normal to get that print running bash export $PATH or is something failing?
If the user is still trying to `` export $PATH ''
then the user is the one who is failing. [see above]

What do you want "printed"? You mean on screen?

echo $PATH

is possible, but it's not clear what you're trying to achieve.

[the answer given by Chuckit satisfied that already anyway.]
( Last edited by Hal Itosis; Apr 20, 2008 at 05:05 PM. )
-HI-
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:07 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,