Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

.cshrc files

Posted on 1998-01-05
2
Medium Priority
?
455 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 100 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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 how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

670 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