When I first started using the C shell in the early 1980s, I made
with all kinds of nice customizations. Aliases, commands to check my
mail, calendar systems, shell scripts in the background to watch
things for me... boy, was this great! Except when I tried to log in,
that is. I was working on an overloaded VAX 11/750. Logging in could
take a few minutes, from when I got the
The C shell seems (to me) to be pretty slow at reading long .cshrc and .login files - especially at setting aliases. So, I learned some ways to get logged in faster. They were especially nice when I was at someone else's terminal and needed to log in for something quick. You might not want to use these exact techniques, but I hope they'll give you some ideas if your logins take too long. The same ideas will work on other shells - but with that shell's commands and syntax, of course.
Add a "quick login" setup to the top of your .cshrc . As soon as the C shell starts and sets a few essentials, this setup asks whether you want a prompt right away. If you answer yes, it starts another C shell with the -f option (important: this makes the skip your .cshrc so you don't get a loop):
From there, I can run a few quick commands.
Typing CTRL-d or
Here's the top of the .cshrc file to set that up:
Maybe you have a set of aliases or setup commands that you use only for
If you don't need that setup every time you log in, you can put the
setup commands in a separate file.
Make an alias named something like
that reads the file into your
Here's the alias:
and the start of the ~/lib/cshrc2 file:
set setup # variable to stop re-sourcing alias foo bar ...
The first line in the cshrc2 file sets a shell variable that keeps the setup alias from re-reading the file into this shell. This saves time if you forget that you've already run setup .
Maybe there are some commands that you want to run only once a day, the first time you log in. For example, I had a reminder system that showed my calendar for the day, reminded me of birthdays, etc. A test like this in .login handles that:
That test usesto get today's date and make an empty file in my tmp directory with a name like ,setup.23 . Once a file is created (say, on June 23), then the setup commands won't run again that day. I have a program that so ,setup.23 will be long gone by the next month's twenty-third day. That could also be done from the .