There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet java laptop malware memory monitor motherboard music network obp printer problem ram registry repair router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: Adding to $PATH

Reply  
Thread Tools
snorkytheweasel's Avatar
Computer Specs
Member with 215 posts.
 
Join Date: May 2006
Experience: UNIX/VMS:Elder Geek; DOS/
03-May-2006, 09: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 18,705 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
03-May-2006, 11:02 PM #2
What did you change in /etc/profile?
snorkytheweasel's Avatar
Computer Specs
Member with 215 posts.
 
Join Date: May 2006
Experience: UNIX/VMS:Elder Geek; DOS/
04-May-2006, 01:11 PM #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 18,705 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
04-May-2006, 07: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, 08:34 PM #5
That solved the problem.

THX!

Now, to document this...........
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:40 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.