"Global" profiles?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers "Global" profiles?
# 1  
Old 12-02-2005
"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  
Old 12-02-2005
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  
Old 12-02-2005
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  
Old 12-02-2005
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  
Old 12-03-2005
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  
Old 12-03-2005
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  
Old 12-04-2005
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

5. UNIX for Dummies Questions & Answers

How to Export Glance "Global System Calls" data to a file

Hello... I'm trying to setup a cronjob to record system data using glance at certain times of the day. My question is, how would one export the "Global System Calls" information to a file? Below is the command I have been using and it works to export CPU information. glance -f ... (0 Replies)
Discussion started by: fumus
0 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

8. Shell Programming and Scripting

AWK -> getting "global" vars

Hello, presently, I'm calling nawk from my main script and have nawk defined in one file. So I call nawk like this nawk -f file input This file defines how to separate mails in /var/mail/$user and show 1 at a time. However, I would also like to do other actions (delete message, forward... (9 Replies)
Discussion started by: petoSVK
9 Replies

9. UNIX for Dummies Questions & Answers

"ap" command not dumping user profiles

System = SCO UnixWare 7.1.1 Using the following command... ap -dgv > users.ap ... I should be able to dump all 250 user profiles to the file "users.ap" and display the results for each account as it is added to the file. The problem is that I only get the following output: UX:ap: INFO:... (0 Replies)
Discussion started by: rm -r *
0 Replies
Login or Register to Ask a Question