|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
[Solved] Add directory to a global PATH
Guys, I did a search on this but couldn't find any thing. I need to add /home/scadm/scripts to the PATH. If I do the below it works for the session I'm in. If I close it and reopen it doesnt work. Code:
PATH=$PATH\:/home/scadm/scripts ; export PATH I also want this path added to all the users in the system. thanks
Last edited by vbe; 06-29-2012 at 10:15 AM.. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
you need to put this in the profile that is loaded when you log in. (.profile .login .kshrc .bashrc , etc ...) just figure out in which profile it is suitable for your need to put it in. For that, you can login and use the Code:
ls -lduart .??* and check which "dot file" has been accessed the latest. By the way ... not sure that the backslash you use is necessary |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
This would be safer syntax. Code:
PATH="${PATH}:/home/scadm/scripts" ; export PATHIf you want to add the path to all users (presumably except system users) then the user's own profile file is the best place. I'd also add it to the skeleton profile file used by useradd ready for the next new user. It may be tempting to modify /etc/profile but beware of modifying the PATH used by the root account or other system accounts because /home may not be mounted all the time. |
|
#4
|
|||
|
|||
|
Thanks it worked, I ended up updating .profile
|
| Sponsored Links | ||
|
![]() |
| Tags |
| env, path |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] /var directory in HP-UX is showing 95%? | yadvinder | HP-UX | 10 | 10-18-2011 01:49 AM |
| Retrieve directory path from full file path through sh | royzlife | Shell Programming and Scripting | 7 | 09-21-2010 08:28 AM |
| How can we copy a directory from Global to Non-global zone? | vijaysachin | Solaris | 8 | 11-18-2009 07:41 AM |
| sharing a directory between local and global zone | binary0011 | Solaris | 1 | 08-29-2009 01:53 PM |
| Global PATH setting | jxh | UNIX for Dummies Questions & Answers | 5 | 07-20-2001 05:23 PM |
|
|