Database updates are currently taking place!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
acer audio boot bsod compaq computer connection crash dell driver drivers error firefox format freeze game hard drive hardware hijackthis install internet laptop linksys macro malware network outlook outlook 2003 outlook 2007 password problem recovery redirect server slow sound toshiba trojan upgrade usb video virus vista vpn windows windows 7 windows vista windows xp wireless youtube
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: Adding to $PATH

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
snorkytheweasel's Avatar
Computer Specs
Senior Member with 191 posts.
 
Join Date: May 2006
Experience: UNIX/VMS:Elder Geek; DOS/Windows:Fossil
03-May-2006, 07:00 PM #1
Solved: Adding to $PATH
[ note: I found quite a few threads on this in the archives, but none of the solutions offered worked for me ]

My current path is /usr/local/bin:/bin:/usr/bin:/usr/local/bin

If I execute from the CLI
export PATH=$PATH:/usr/local/sbin:/sbin:/usr/sbin:
I get the correct result $PATH becomes /usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin

I've modified
  • /etc/skel/.bash_profile
  • /etc/skel/.bashrc
  • /etc/bashrc
  • /etc/profile
adding the following:
/usr/local/sbin:/sbin:/usr/sbin to the existing PATH=$PATH: statement
the export statement in each case already includes PATH

And for good measure, rebooted.....

None of the attempted changes stick.

Among the possible exisiting anomalies in my system:
echo $BASH_ENV yields an empty result set; somewhere in the system BASH_ENV is defined as ~/.bashrc - which doesn't exist for either root or for me.

No doubt I've made some itsy-bitsy syntax error or modified the wrong files.

Can we take it from the top and give explicit step-by-step instructions on how to add directories to the path - and to make that change permanent for all users (in my case, it's just me & my alter ego, root)?
Squashman's Avatar
Trusted Advisor with 15,914 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
03-May-2006, 09:02 PM #2
What did you change in /etc/profile?
snorkytheweasel's Avatar
Computer Specs
Senior Member with 191 posts.
 
Join Date: May 2006
Experience: UNIX/VMS:Elder Geek; DOS/Windows:Fossil
04-May-2006, 11:11 AM #3
Adding to $PATH
modified highlighted line in /etc/profile:

if [ $( id -u ) -gt 14 ]; then
ulimit -c 1000000
umask 002
PS1="[\u \W]\\$ "
PATH=$PATH:/usr/local/bin
else
umask 022
PS1="[\u \W]# "
PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:
fi
Squashman's Avatar
Trusted Advisor with 15,914 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
04-May-2006, 05:33 PM #4
Add that path statement to the bottom of your /etc/profile and then export it.

PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
export PATH
snorkythewea's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Mar 2006
Location: Great Northwet
Experience: Einstein
04-May-2006, 06:34 PM #5
That solved the problem.

THX!

Now, to document this...........
Closed Thread Bookmark and Share   techguy.org/464580

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:23 PM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by Cermak Technologies, Inc.