Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.cshrc files

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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

885 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