The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" iBot UNIX and Linux RSS News 0 01-04-2008 03:00 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
AWK -> getting "global" vars petoSVK Shell Programming and Scripting 9 05-28-2006 08:56 AM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 04:15 AM
"ap" command not dumping user profiles rm -r * UNIX for Dummies Questions & Answers 0 08-31-2005 11:44 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-02-2005
amheck amheck is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 16
"Global" profiles?

Hi, for all of the users on our boxes, we have a .profile in each home directory. That's fine. But I have some PATH statements that I want to apply for ALL users once they log in. And I'm hoping not to have to edit all user's .profile files in each dir on each box.

Is there a global or team profile that I can use for this purpose?

Thanks!
Aaron
  #2 (permalink)  
Old 12-02-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
There is a file in /etc called profile, which is executed for every user that logs in. From the man page of profile:
Quote:
profile(4) profile(4)

NAME
profile - set up user's environment at login time

DESCRIPTION
If the file /etc/profile exists, it is executed by the shell for every user who logs in. The file /etc/profile should be set up to do only those things that are desirable for every user on the system, or to set reasonable defaults. If a user's login (home) directory contains a file named .profile, that file is executed (via the shell's exec .profile) before the session begins. .profile files are useful for setting various environment parameters, setting terminal modes, or overriding some or all of the results of executing /etc/profile.
So you can set your variables in the /etc/profile, but they will be overridden if the user sets the same variables to some different value in his/her own .profile.
  #3 (permalink)  
Old 12-02-2005
amheck amheck is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 16
Basically, we're installing some new software and we want the path to those new scripts, etc, to be in everyone's profile. But....everyone also has their own .profile, so it sounds like if I set them in /etc/.profile, they'll just be overwritten.

Someone mentioned something about a .profile_team that could be used, but I can't find anything about it.
  #4 (permalink)  
Old 12-02-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
There is a provision in ksh that allows you to set readonly variables. You can use the command typeset with the '-r' option to do so. I do not know if this can be used in this case, I am just providing you with an option that you could try out.

Also, the file is not /etc/.profile, it is /etc/profile.
  #5 (permalink)  
Old 12-03-2005
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
Quote:
Originally Posted by amheck
Basically, we're installing some new software and we want the path to those new scripts, etc, to be in everyone's profile. But....everyone also has their own .profile, so it sounds like if I set them in /etc/.profile, they'll just be overwritten.
A user can find a way to reset environment variables no matter what you do. Set the PATH in /etc/profile. Warn users not to remove the stuff you put in PATH. But in their own .profile, they can still do:
PATH=$PATH:/some/other/directory
and that is a good thing.
  #6 (permalink)  
Old 12-03-2005
amheck amheck is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 16
Thanks guys. Well maybe this was real simple. I thought if I have an /etc/profile, it will be overwritten with the users .profile. It sounds like they can work in conjunction.
  #7 (permalink)  
Old 12-04-2005
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,617
Just in case your OS is AIX: there is a file /etc/environment, where generally set environment variables are stored in the form "variable=value". It is read prior to /etc/profile.

bakunin
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0