The UNIX and Linux Forums  

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 11:00 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-19-2007 09:52 PM
AWK -> getting "global" vars petoSVK Shell Programming and Scripting 9 05-28-2006 05:56 AM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 12:15 AM
"ap" command not dumping user profiles rm -r * UNIX for Dummies Questions & Answers 0 08-31-2005 08:44 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Dec 2005
Posts: 14
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
"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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-02-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,313
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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.
Reply With Quote
  #3 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Dec 2005
Posts: 14
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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.
Reply With Quote
  #4 (permalink)  
Old 12-02-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,313
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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.
Reply With Quote
  #5 (permalink)  
Old 12-02-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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.
Reply With Quote
  #6 (permalink)  
Old 12-03-2005
Registered User
 

Join Date: Dec 2005
Posts: 14
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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.
Reply With Quote
  #7 (permalink)  
Old 12-04-2005
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 933
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash exec bash for loop command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix export command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script rsync ftp scp recursive segmentation fault(coredump) sftp script snoop unix solaris change ip address stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix mtime unix simulator unix.com vi substitute while loop within while loop shell script


All times are GMT -7. The time now is 03:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101