#This file is named .profile #The Korn shell executes the commands in this file when you log in. #Page numbers in this file refer to the ksh(1) manual page. #"export" (p. 41) creates an environment variable (pp. 23-24). #Directories shell searches for executables: pp. 16, 27. gcc is C compiler. export PATH=$PATH:/opt/gcc453/bin:. #The -t option of man makes man run this program. #~mm64 is the full pathname of mm64's home directory: pp. 4-5. export TCAT=~mm64/bin/tcat #The editor to be invoked by mail, mailx, dbx, etc: p. 14. export EDITOR=/bin/vi #Make vi display the words INSERT MODE while you're in insert mode. export EXINIT='set showmode' #or export EXINIT='set showmode number' #The name of the computer. export HOST=`hostname` #The Korn shell will check this file for new mail every 10 minutes: p. 16. export MAIL=/var/mail/$LOGNAME #Default printer for the lpr, lpq, lprm programs. export PRINTER=edlab #Source code directory on the web at http://i5.nyu.edu/~mm64/INFO1-CE9545/src/ export S45=~mm64/public_html/INFO1-CE9545/src #if necessary to make your screen editor (vi, emacs, pico) work properly export TERM=vt100 #Make the command numbers in the prompt start at 1 each time you log in: #p. 27 for .sh_history. ~ is the full pathname of your home directory: pp. 4-5. rm -f ~/.bash_history #Prompt string one. See pp. 10-12 for chopping, p. 16 for !. #The %%.* chops off the end of $HOST: i5.nyu.edu becomes i5 #The ##*/ chops off the beginning of $PWD: /home1/a/abc1234 becomes abc1234 PS1='! ${HOST%%.*}:${PWD##*/} $ ' #The following command must come *after* the export EDITOR=/bin/vi. #otherwise the export EDITOR=/bin/vi would turn emacs mode back off (p. 12). #Retrieve and edit previous commands with emacs, pp. 28-32. #See pp. 46-50 for set. set -o emacs #Make the 4 arrow keys work in emacs mode, pp. 28-32. Only in ksh93, sorry. #/bin/loadkeys ~mm64/public_html/INFO1-CE9545/src/loadkeys_set #Don't let control-d log you out (p. 48): must type "exit" (p. 41). set -o ignoreeof #Don't let > destroy the existing contents of a file: pp. 22, 49. set -o noclobber #For alias, see pp. 3-4, 39. #"history" is itself an alias for "fc -l", pp. 4, 42. alias h=history #See all the jobs you're running, pp. 25, 43. alias j=jobs #/bin/mailx is better than /bin/mail. Used in line 81. alias mail=mailx #Turn off last 2 r and w bits of a newborn file. For example, date > newborn #will create a newborn file whose bits are rw-------. The octal argument of #the umask command has a 1 in each bit that should be turned off. See p. 55. umask 077 #Let other people send you messages with the talk program. #It turns on the two rightmost w bits of your terminal. mesg y #See new and unread mail in alphabetical order of who sent it. #Can use an alias (mail) as first word of command, and also after | && || ; mail -e && mail -H | grep '^.[NU]..[0-9]' | sort +0.6f -0.25 +0.6 -0.25 +0.2n #date #cal #who | grep def5678 #~mm64/bin/moon