Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to get PATH set right

Status
Not open for further replies.

nroberts420

Programmer
Jun 24, 2003
27
US
I am having a really hard time getting the path in my .bash_profile file set so I can run all the commands in /sbin from the command line with out having to supply the path. My .bash_profile file looks like this:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/sbin
export PATH
echo $PATH
unset USERNAME

I assume this should work because if I run the command PATH=/sbin:$PATH from command line then everything works. Just for some reason not from the .bash_profile file.

Nate
 
check to make sure that the .bashrc file calls the
.bash_profile script. Maybe use an entry like echo 'hello' or sumthing equally unimaginative.

I keep everything in .bashrc because it works... ;-)
 
Make sure you source the file after you change to make the changes take affect.

source ~/.bashrc


>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top