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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify Default Path and Existing Users "PATH" 1

Status
Not open for further replies.

johndrake

Technical User
Jul 25, 2002
97
Hi All,

I want to be able to add the following path, /tools/bin, to the following:

1. New users - I modified the the /etc/environment file
(I believe --- I'm working from memory and I am not at the
office) and added the /tools/bin, to the path specified here
in this file system. My belief was that when you use "smit"
to create a new user it picks up the default path from here.
I then created a new user and the additional path was not
in the the users .profile.

2. Old users - Is their any easy to add this path onto the
users .profile without writing a script to do this?

Thank you,

-Joe
 
You can add the /tools/bin directory to the PATH variable in the /etc/profile file. This profile will be started for every user when he logs on. After that the user specific .profile will be executed.

/etc/profile is the system wide profile for all users.

Richard
 
Hello Richard,

Thank you very much for the tip, I will try it.

-Joe
 
I prefer to modify /etc/environment myself, I believe that one gets processed prior to actually starting a shell. ksh just puts up /etc/profile, so if someone is using something besides ksh, they might not get your new PATH.

example: I use a custom compile of lynx as a menu system for a certain group of users, as their login shell. Since it's not ksh, it doesn't read /etc/profile, but when I put PATH changes in /etc/environment, they get them just fine.

The caveat of this is that if another (later) script does an absolute set of PATH instead of adding onto it, they'll clobber whatever you set anyway. (my dbas are notorious for doing that)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top