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

How to run the script for all users? 1

Status
Not open for further replies.

praise12

IS-IT--Management
Mar 17, 2002
17
US
I have a script in my home directory, how to get the all users in the same Unix box to use that script from any directory/path?

Many Thanks,
 
Make sure that the path to your directory in included in all user's PATH variable. One of the easiest ways to do this is to include it in the global /etc/profile. Also, make sure that the script is executable by all. Hope this helps.
 
Hi
You can also create a link to your script in some directory that is already in everyones path.
 
Thanks all for the answer. I will try both way.

Hey, KenCunningham, how to include it in the user's PATH variable? Does it in user's .profile? if yes, how? please could you provide me with an example?
Thanks so much!!
 
To include another path in the PATH variable, you can edit the .profile and add someting like:

PATH=$PATH:/path/to/be/added ; export PATH

The $PATH: is important in that it ensures that any paths previously set up are preserved. A simpler way of achieving this (in ksh) is:

export PATH=$PATH:/path/to/be/added

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top