->Title Page
->Intro
->Unix
-->Overview
-->File Structure
-->Online Manual
-->Basic Commands
-->Additional Commands
-->Login files
--->.cshrc
->.login file
-->Special characters
-->Miscellaneous Tips
-->Things to try
->Vi editor
->Mirror sites
->Further reading

[ Up ]
[Prev][Home][Next]
[Author]

Unix ---> The .login file

The following is an example .login file. The same rules apply here as did with the .cshrc file.


###########################################################
#                                                         #
#         Example .login file                             #
#                                                         #
#         by Chris Taylor                                 #
#                                                         #
###########################################################

# Set erase, kill, and interrupt keys
stty crt erase '^H' kill '^U' intr '^C'

# Set the creation mask setting so that everyone can read
# my files but can't write to them
umask 022

## Set environment variables
# Set my terminal type to xterm
setenv TERM xterm

# Select vi as my editor of choice
setenv EDITOR /usr/ucb/vi

# Show the path to my mailbox
setenv MAIL /usr/spool/mail/$USER

# Set mail program
setenv MAILER /usr/ucb/mail

# Set paging program
setenv PAGER more

# Set default printer
setenv PRINTER hp

if (-f /bin/sun != 0) then
  # Using a Sun
  if ("`tty`" == "/dev/console") then
    # Using console
    setenv DISPLAY $cpu":0.0"
    # Ask if I want to start X11
    echo ""; echo -n "Start up X11? "
    set ans = $<
    if ("$ans" != "n" && "$ans" != "N") then
      # Start X11
      setenv DISPLAY $HOST\:0
      stty -tostop
      exec xinit .xstartup ; kbd_mode -a
      clear
    endif
    unset ans
  else
    setenv DISPLAY `last | grep $USER | head -1 |          \
    awk '{print $3}' | awk '{FS=".";print $1 "." $2 ":0" }'`
  endif
endif

# end of .login file

Please notify owners of webpages with outdated links to these pages

Find this site useful? Want to give something back?

© 1993-2001 Christopher C. Taylor