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

the .cshrc file

Status
Not open for further replies.

DedeMole

Programmer
Aug 30, 2001
45
US
I'm searching for help on sourceing the .cshrc file. I'm using solaris 8.

I have 12 user accounts on my server. I modified the .cshrc file for user-1 to get some programs running, and instead of making the same change for all the users I just copied and replaced user-1's .cshrc file to all the users. BUT when I log on as user-2 the .cshrc file doesn't automatical source itself like it used to do. If I type -- source .cshrc -- then everything works.

How do I fix the .cshrc file so I don't have to manually type source .cshrc after I've logged in. Any and all help is greatly appriciated....
 
maybe the file should be owned by each particular user using it. if you copied the file multiple times, say as root, maybe all the files are owned by root. just a thought, might not be the case.
 
Hi,
every user gets

/home/<userid>/.cshrc

which is a soft link to

/etc/defaults/.cshrc

In this script the Administrators build a global .cshrc file that only they control and put in what they need from PATHS to ALIASES to Environment variables.

#! /bin/csh

# admins put whatever
# default set ups theye need here
# and
# Here

# then at the bottom of the script they
# allow the user to add their own customizations.

if ( -e ~/.cshrc_myown ) then
source ~/.cshrc_myown
endif


the user puts their customizations in

/home/<userid>/.cshrc_myown

----
 
If you are using useradd to add users to your system, you can get help to distribute custumized .login and .cshrc for every new user. On your machine there should be a katalog called /etc/skel. If you put a .login and a .cshrc of your liking in this katalog, useradd will take these files and put then in the home katalog of your new user. In this customized .cshrc, you can put a line &quot;source /export/mykatalog/my_csh_env&quot; and then put your enviroment variables in my_csh_env. If you need to change anything, you do the changes in my_csh_env, and the next time the user logs in, they will get these change. In this way you dont have to change every users .cshrc file.
One thing you allways should check is permissions and ownership of .login and .cshrc. User should always be owner and have atleast read permissions on these files. If you want to protect .login and .cshrc from user changing them, set root as owner with &quot;rw&quot; permission and users group as group with &quot;r&quot; permission

thorkild

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top