Editing $PATH in .bash_profile | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Editing $PATH in .bash_profile

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-31-2002
Atama Atama is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 15 October 2002, 10:42 AM EDT
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Editing $PATH in .bash_profile

Hello,

I'm trying to add my bin directory to my path by editing the .bash_profile. I'm adding the following:

PATH=$HOME/bin

But then when I type in "echo $PATH" my bin directory is not added. Do I need to do something to make this take affect or am I going about this wrong.

Thanks!
Sponsored Links
    #2  
Old 01-31-2002
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
 
Join Date: Nov 2001
Last Activity: 23 October 2011, 10:07 PM EDT
Location: Brisbane, Australia
Posts: 509
Thanks: 7
Thanked 0 Times in 0 Posts
After editing your path, you need to export it.
export PATH
Sponsored Links
    #3  
Old 01-31-2002
wizard wizard is offline
Registered User
 
Join Date: Nov 2001
Last Activity: 11 February 2002, 9:50 AM EST
Posts: 60
Thanks: 0
Thanked 1 Time in 1 Post
Are you exporting the variable? If not, use

export PATH
    #4  
Old 01-31-2002
Atama Atama is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 15 October 2002, 10:42 AM EDT
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Isn't there a way to make the change take affect immediatley in the Bash Shell like the "source" command under the C Shell environment.

Thanks!
Sponsored Links
    #5  
Old 01-31-2002
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
 
Join Date: Nov 2001
Last Activity: 23 October 2011, 10:07 PM EDT
Location: Brisbane, Australia
Posts: 509
Thanks: 7
Thanked 0 Times in 0 Posts
Do the following until you logout ...
. .bash_profile

I hope that's right, otherwise, logout and log back in.
Sponsored Links
    #6  
Old 01-31-2002
Atama Atama is offline
Registered User
 
Join Date: Jan 2002
Last Activity: 15 October 2002, 10:42 AM EDT
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Uh Oh, I've really done it this time. That Path statement is supposed to read: PATH=$PATH:$HOME/bin. I left out the $PATH portion. What that means is, my home directoy cannot locate any of the commands, including VI to edit the .bash_profile.

I do not have root access on this box, but I do have access to another home directory.

So, is it possible to login from that directory and edit the .bash_profile?
Sponsored Links
    #7  
Old 01-31-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 28 November 2014, 10:37 AM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 438 Times in 261 Posts
Type:
/usr/bin/vi .bash_profile
to edit the file while your path is screwed up. This assumes that vi is in /usr/bin. You can use that other account to locate it if needed.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Configure $PATH in /.bash_profile or /etc/paths? Alexander4444 UNIX for Dummies Questions & Answers 4 02-23-2012 07:14 PM
Add Variable in .bash_profile dbashyam Shell Programming and Scripting 4 05-24-2011 04:53 AM
bash_profile or .profile big123456 UNIX for Advanced & Expert Users 5 01-04-2011 10:24 AM
question in .bash_profile hannem Shell Programming and Scripting 1 08-01-2008 08:09 AM
Unrecognized Path in .bash_profile monkfan UNIX for Dummies Questions & Answers 1 09-01-2007 01:36 AM



All times are GMT -4. The time now is 05:44 AM.