: tcsh is not in our machines's /etc/shell, so I can't use tcsh as
: login shell. Is there a way to start tcsh automatically, perhaps
: by placing a command in .cshrc? I tried by placing 'exec tcsh' in
: .cshrc, but it doesn't work. I don't want to do so by placing
: commands in .login, because I use 'rsh xterm' to enter this
: machine, not by logining, thus .login is not read. Thanks very
: much.
Its /etc/shells not /etc/shell (minor point)
The problem with executing tcsh from csh is that tcsh often likes
to read .cshrc and .login as well csh, so you can get the exec getting
exec'd again when tcsh starts.....
The fix for this is to test what shell you are running before you run the
exec line. In my ~/.login I have something like the following...
if (-x ~grs/bin/tcsh) then
if ( $shell == /bin/csh ) then
exec ~grs/bin/tcsh -l
endif
endif
If you wish to get xterm to use tcsh add the line...
setenv SHELL tcsh-path
to your X initalisation file (probably ~/.xsession, ~/.xinit or even
~/.environ). It is probably not a good idea to put the exec in your
.cshrc since this stops the use of csh all together, and you never know
when you might need it.
--
Brian Blackmore, The University of Kent at Canterbury, United Kingdom.
Beyond the shadow of a dream, who knows what lies.
Ok, here is how I do it:
1) I am running a csh as the default login shell (specified in /etc/shells). This
means that I will place my 'exec tcsh' in the .cshrc file. If you are running
in a bourne like shell, then you will need to modify your .profile file instead.
2) According to Unix Power Tools (O'Rielly & Associates), you should create a hard
link or symbolic link in your home directory to the tcsh that you want to use.
When you name the symbolic link, make it with a dash in front of it...
cd $HOME
ln $HOME/bin/tcsh -tcsh
For whatever the reason, this is suppose to make your tcsh look like a real
login shell. All I can tell is that it makes the process table look like you
are running a real login shell.
3) Modify your .cshrc file as follows:
if (! $?prompt) goto cshrc_end
if (! $?tcsh) exec -tcsh
[ the rest of your .cshrc file goes here ]
cshrc_end:
4) You are done! Hint: Don't log out of your account until you have tried it
by logging in from another account! If something goes wrong and this does
not work, then you will want to be able to undo it!
Good luck!
Scott
--
Actually, tcsh has a -l option for exactly this purpose:Quote:> 2) According to Unix Power Tools (O'Rielly & Associates), you should create a hard
> link or symbolic link in your home directory to the tcsh that you want to use.
> When you name the symbolic link, make it with a dash in front of it...
> cd $HOME
> ln $HOME/bin/tcsh -tcsh
Make sure you only do this in an interactive shell:
if ( ! $?tcsh && $?prompt) exec tcsh -l
Casper
I haven't tested this, but it should work. Put the following line atQuote:>tcsh is not in our machines's /etc/shell, so I can't use tcsh as login
>shell. Is there a way to start tcsh automatically, perhaps by placing
>a command in .cshrc? I tried by placing 'exec tcsh' in .cshrc, but it
>doesn't work. I don't want to do so by placing commands in .login,
>because I use 'rsh xterm' to enter this machine, not by logining, thus
>.login is not read. Thanks very much.
if ($?tcsh == 0) exec tcsh
************************************************************************
Past performance is no guarantee of future results.
hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer
when running rsh, the remote shell gets the command it has to exec on
its command line
truc> rsh dull.machine echo hello
might start your remote csh shell like that:
In your .cshrc, you just can't get the 'echo hello': it's not in theQuote:>>>> csh -c 'echo hello'
If you meant 'rlogin' instead of 'rsh' (rsh with no argument is
actually an rlogin), than that isn't a problem.
Stefan
--
-----------------------------------------------------
-- On the average, people seem to be acting normal --
-----------------------------------------------------
I personally use:
if ( ! $?prompt ) then
# set up a simple path and get outa here!
setenv ARCH `/bin/arch`
set path=( /bin /usr/bin /etc /usr/local/bin $path )
set path=( . /home/ln_smr/{scr,bin.$ARCH} /usr/bin/X11 $path )
exit 0
else
# get the right shell
# SHELL should be set to tcsh, but then a lot of shell checks would fail!
if ( ! $?NO_TCSH && ! $?tcsh && -x ~ln_smr/bin.`/bin/arch`/tcsh ) then
echo Starting tcsh...
setenv SHELL /bin/csh
exec ~ln_smr/bin.`/bin/arch`/tcsh -l
exit 0
endif
endif
# set up aliases etc.
which works just fine (you'll have to change the paths a little
probably :-) )
Steve
In your .login you can add:
if ( ! $?tcsh ) then
exec tcsh -l
endif
the -l option, tells tcsh to behave like a login shell.
christos
Please correct me if I am wrong.
Charles
--
===============================================================
_/_/_/ _/ _/
_/ _/ _/
_/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/_/ _/_/
_/ _/ _/ _/ _/ _/ _/ _/_/ _/ _/
_/_/_/ _/ _/ _/_/_/_/ _/ _/_/ _/_/_/ _/_/_/
Charles QC Chan
Undergraduate Computer Engineering
University of Michigan, Ann Arbor
>> In your .login you can add:
>> if ( ! $?tcsh ) then
>> exec tcsh -l
>> endif
>> the -l option, tells tcsh to behave like a login shell.
>Wouldn't that make tcsh source your .login file again?
>That may not be necessary, especially when some system, like ours,
>set up in such a way that the .login file will read the news of the
>day. Thiss can take quite an amount of time.
Erwan
--
45 rue d'Ulm | | je m'en rapproche de plus en plus"
FRANCE | | Julos Beaucarne
>>> In your .login you can add:
>>> if ( ! $?tcsh ) then
>>> exec tcsh -l
>>> endif
>>> the -l option, tells tcsh to behave like a login shell.
I don't understand why the .login file is being sourced again... Isn't theQuote:>>Wouldn't that make tcsh source your .login file again?
>>That may not be necessary, especially when some system, like ours,
>>set up in such a way that the .login file will read the news of the
>>day. Thiss can take quite an amount of time.
> Yes it would, but if you change your "login shell" to /bin/sh
>(via chsh), and put exec tcsh -l in your .profile, it will be read
>only once.
Scott
--
But if you place the exec in the .cshrc it will be called every time
you start a subshell, too.
: (By the way, when I tinkered around with the above, I actually
: placed echo statements in both the .cshrc and .login files so that I knew
: things were working like they were supposed to... so I do know that .login is
: sourced only once...
Correct. ".cshrc" is sourced for every (new) instance of *csh. The
".login" is only sourced as part of the login process (indeed, as you
point out, after the .cshrc).
Chris
--
VISIONWARE LTD, 57 Cardigan Lane, LEEDS LS4 2LE, England
-------- "Visionware: The home of DOS/SQL/UNIX/X/VMS integration" --------
i also have a file, .hushlogin (contents irrelevent) that give me a
'quiet' login. (no motd)
this set up has worked for me for quite a while, hope it helps.
--
matthew
^^^^^^^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Actually, this is controlled by a tcsh compile time constant. I believeQuote:>...
>I don't understand why the .login file is being sourced again... Isn't the
>.cshrc file sourced *first* and then the .login? If this is the case, then
************************************************************************
The Zapruder film was a*film.
hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer
1. Although XFS is in /etc/rc.d/rc3.d,rc5.d, it does not start automatically
Hi,
I am using Redhat 6.1 with xfs version 3.3.5-3. XFS will not
start automatically, although in /etc/rc.d/rc3.d and rc5.d it
is listed as S90xfs. I can start it manually, nevertheless.
How to get it to start automatically again and why not working now?
Thanks
Mike
2. Distributed Modem Pool Software version 1.4
3. How to autostart tcsh when it is not in /etc/shells?
5. Am at sea with so many shells -- tcsh, ksh, zsh or bash?
7. apm does not start automatically
8. illegal instruction in shared library
9. /etc/shells - getusershell - /bin/tcsh ????
10. How can named be started automatically at boot time not by manual?
11. Making KDE not start automatically
12. lilo not automatically start
13. Switching to Tcsh from Csh, no /etc/shell