?
Solved

Terminal window does not run .cshrc

Posted on 1998-01-07
20
Medium Priority
?
528 Views
Last Modified: 2008-03-17
When I open a terminal window, the file .cshrc which is supposed to run, does not.  I have to type: source .cshrc every time I open a new terminal.  It used to do it automatically - I have not moved the file, but may have copied it and overwritten the original, but it is now in the correct place, with the correct name - how do I fix it?
0
Comment
Question by:tomnich
[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
  • 7
  • 4
  • 3
  • +4
20 Comments
 
LVL 2

Expert Comment

by:mlev
ID: 2008542
Assuming your default shell is tcsh, maybe you try "tcsh -X" and see if anything special pops up? There may be some failing statement that causes .cshrc to exit (though normally you would see the error message). Or maybe you have .tcshrc, then .cshrc is not read.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008543
which shell are you using? csh, tcsh
Will .cshrc be run if you do a
  su - user
0
 
LVL 32

Expert Comment

by:jhance
ID: 2008544
What OS are you running and which window manager are you using with it?  For example, on HP VUE, you edit the .vuerc file instead of the .cshrc.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008545
jhance, your answer isn't bad, but not true also.
In $HOME/.vueprofile you just specify which and how a resource
file will be read, for example:
  source $HOME/.cshrc
or
  . $HOME/.profile
0
 
LVL 1

Author Comment

by:tomnich
ID: 2008546
It's running on an HP machine
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008547
tomnich, please post folloing information:

  echo $SHELL
  grep your_user_id /etc/passwd
  grep -v '^#' .vueprofil
0
 
LVL 1

Author Comment

by:tomnich
ID: 2008548
The shell is csh
OS is HPUX with X-Windows
echo $SHELL gives: /usr/bin/csh
.vueprofil does not exist
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008549
uups, was a typo, must read:  .vueprofile
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2008550
If you are using xterm or dtterm make sure that it starts a login shell by giving the -ls option on the startup command line or by setting the LoginShell X resource to True - the default is false.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008551
braveheart, .cshrc has nothing to do with a logon shell
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2008552
I know that but does tomnich?  Besides, lots of people combine .cshrc and .login with tests to bypass the bits they don't want to execute.
0
 
LVL 1

Author Comment

by:tomnich
ID: 2008553
Sorry, It was running .cshrc all the time, but I had added the alias: "alias  !! rr" and for some reason .cshrc was "crashing out" or something like that.  The question is now:

"Why can't I add the above alias without .cshrc crashing?"
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008554
what should this alias do?
0
 
LVL 1

Author Comment

by:tomnich
ID: 2008555
It allows you to repeat the last command by entering: rr
0
 
LVL 84

Expert Comment

by:ozo
ID: 2008556
I don't think
  alias !! rr
will do that
  alias rr '\!-1'
works, (but doing it twice in a row isn't very useful...)

0
 
LVL 2

Expert Comment

by:mlev
ID: 2008557
I guess it was meant to be:
alias rr \!\!
0
 
LVL 84

Expert Comment

by:ozo
ID: 2008558
alias rr \!\!
doesn't work very well either, since the !! refers to the rr command itself.
(which is useful for things like alias rr 'comand \!*')
0
 

Accepted Solution

by:
rmgopal earned 140 total points
ID: 2008559
I assume u r logging on to the unix through a PC with either Windows 95/NT operation system using terminal emulation software like eXceed etc. Also ur login shell is c shell.

To have .cshrc run on a terminal window u should have a file called .Xdefaults (dot capital X defaults) in your home directory with the following lines

*loginShell:  true

The file should contain only the above line and that should be the first line starting at first column.

If  the file does not exist, create the file with the above line and save it in your home directory. Logout of unix. If possible shutdown the pc and startover. Now logon to unix. U should have .cshrc executed.

Hope the above solution should work. Good luck.

Thanks,
Ravi.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008560
Either the eXceed developers (or technical writers for docs) should be dammed, or rmgopal didn't read carefully the docs about X Windows :-(

> The file should contain only the above line and that should be the first line starting at first column.

This would violate a couple of X Window standards.

Nevertheless it could be an answer to the question.
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2008561
Hmm. rmgopal seems to have given half my suggested solution, combined with an urban myth, although he has spelt it out a little more clearly. The line does *not* have to appear on its own.
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

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

762 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