Solved

.cshrc files

Posted on 1998-01-05
2
451 Views
Last Modified: 2013-12-16
Hi,
I am running a tcsh on solaris 2.5, i have a .cshrc and .cshrc2 file in my home directory, in the .cshrc file I have a entry "source .cshrc2" in the .cshrc2 file, there are lots of aliases.  When i su to root which is running a csh, the only way I can use the aliases as root is to go into my home directory and type " source .cshrc2" which is kinda annoying!
Does anybody know how i can get root to read the .cshrc2 file when i su ? I dont really want to change the type of shell root runs.

Cheers :)
0
Comment
Question by:ianfoster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 1812847
Several ways:
1. ln -s user_home_dir/.cshrc root_home_dir/.cshrc
2. add .cshrc to /etc/csh.cshrc
3. source .cshrc2 in /etc/csh.cshrc

But always keep in mind (or read csh man-page) that csh is a bit
strange when reading its resource files: .cshrc and .login . May be it's better to do some of your hacking from .cshrc in an other
file processed during csh startup (like .login).
0
 
LVL 1

Expert Comment

by:vancleef
ID: 1812848
Another way is to create an alias for root that can be used to
source your file.  That way other root users will not be confused
by your aliases.  I recommend keeping root's defaults very
simple, to allow easy logins during troubled times.

An alternative is to created a second root account "root2" with
a separate home directory that has everything that you want in
the way of aliases.  That way the primary account, root, can be
left with the borne shell, a short path, and minimal aliases.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question