Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2001 13:59:52 -0400 (EDT)
From:      Dru <genisis@istar.ca>
To:        Fernan Aguero <fernan@iib.unsam.edu.ar>
Cc:        <questions@FreeBSD.ORG>
Subject:   Re: .cshrc not being used?
Message-ID:  <20010906134308.N28322-100000@x1-6-00-50-ba-de-36-33.kico1.on.home.com>
In-Reply-To: <20010906142707.E2088@iib005.iib.unsam.edu.ar>

next in thread | previous in thread | raw e-mail | index | archive | help


On Thu, 6 Sep 2001, Fernan Aguero wrote:

> +----[ Dru (genisis@istar.ca) dijo sobre "Re: .cshrc not being used?":
> |
> |
> | On Thu, 6 Sep 2001, Fernan Aguero wrote:
> |
> | > +----[ Dru (genisis@istar.ca) dijo sobre "Re: .cshrc not being used?":
> | > | Hi Fernan,
> | > |
> | > | Did you either logoff and back in or do a:
> | > |
> | > | source .cshrc
> | >
> | > Of course. Logging off and back in does nothing. However if i do a
> | > source .cshrc everything works OK.
> | >
> | > Should I create a new .rc file with my additions and then source it
> | > from .cshrc?
> |
> | Still strange that logging off does nothing but source works OK as both
> | methods should force the shell to reread the .cshrc file. Not sure what
> | you mean by a .rc file. Do you mean adding a file called dot.cshrc to
> | /usr/share/skel so all new users will get the new and improved .cshrc
> | file?
> |
> | Dru
> |
> +----]
>
> Nope. I mean adding a ~/.myrc file with my own entries, like:
> setenv MYVAR /whatever
> setenv OTHERVAR value
> set prompt = "me# "
> etc
> and then add the following line to ~/.cshrc
> source .myrc
>
> Anyway, it doesn't work since the .cshrc is not read in the first
> place.
>
> But, I must admit that when I said logging off and back in I was
> talking about doing it in xdm. All of this behaviour that I'm talking
> about is only seen in an xterm.
> If I go to the console then my .cshrc is read OK. In an xterm my
> .cshrc is ignored. Only if I do a source .cshrc in the xterm do i see
> a change.
>
> Reading xterm man page says that xterm -ls should be a login shell
> (i.e. it will read the user's .profile and .login files). I assume
> that it will also read .cshrc but it is not explicitly said. But it
> does not appear to be the case.

Out of curiousity, why not just edit .cshrc directly instead of having it
invoke a separate file?

As for the login and non-login shell stuff, here's my understanding in a
nutshell:

-a login shell is invoked when you enter your name/password at a login
prompt or when you type xterm -ls to open up an xterm. What login shell
you get depends on what shell you were given when your account was
created, you can doublecheck this with a:

more /etc/passwd | grep username

If you are in the Bourne shell or /bin/sh, it reads .profile when the
login shell is started. If you are in the C shell (/bin/csh or /bin/tcsh),
the files .login and .cshrc are read.

-a non-login shell is invoked whenever you start another shell from a
login shell; you can start whatever shell you want as long as it's
installed on the system. If you're starting the Bourne shell, nothing is
read; if you're starting the C shell, .cshrc is read.

Which makes me wonder what shell the user is in, since if it's the C
shell, the .cshrc file should be read regardless if its a login or a non-login
shell.

HTH,

Dru


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010906134308.N28322-100000>