1833838 Members
2677 Online
110063 Solutions
New Discussion

Re: .cshrc

 
khilari
Regular Advisor

.cshrc

Hi people, well .cshrc is in the user folder. I wanted to know does it have to be in the root directory for root.

Thanks.
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: .cshrc

The only reason root would need to have .cshrc is if root used the C shell. Since root should NEVER use anything but the posix shell, root does not need to have .cshrc.


Pete

Pete
Jeff_Traigle
Honored Contributor

Re: .cshrc

Since you should always leave root's shell as /sbin/sh, you don't need .cshrc in the root directory.
--
Jeff Traigle
James R. Ferguson
Acclaimed Contributor

Re: .cshrc

Hi Khilari:

The '.cshrc' file is the first file sourced (read) by the C-shell during login. It contains variables and aliases. After it is read, the '.login' file is read. Normally this file contains terminal settings.

These files are normally placed in the user's $HOME directory as a part of a standard user setup.

The placement of these files for use by 'root' whould correspondingly be in root's $HOME directory.

*Be* *sure* that you *never* make the default shell for root (in '/etc/passwd') anything other than '/sbin/sh' (the Posix shell)! To do so will leave you with a system that will not start-up!

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: .cshrc

Shalom,

The file is useless unless the c shell is defined for the user in /etc/passwd or a shell script spefically uses it.

For a user it belongs in the home directory which is also defined in /etc/passwd

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com