Appendix A. Sample .profile File

This appendix contains a sample .profile file. Notice that the environment variables are set and exported with one typeset command. This speeds up processing of the .profile file.

				#
				#     Sample .profile File
				#
				# Set/export environment variables
				typeset -x CDPATH=:$HOME:/usr/spool \
				EDITOR=vi \
				ENV=${HOME:-.}/.env \
				HISTFILE=$HOME/.history \
				HISTSIZE=200 \
				HOME=/home/anatole \
				LOGNAME=anatole \
				MAILCHECK=300 \
				MAILPATH=∼/inbox:/usr/spool/mail/$LOGNAME \
				PAGER=$(whence more) \
				PATH=${PATH#:}:/usr/etc:$NEWS/bin: \
				PS1='!:$PWD> ' \
				PS4='[$LINENO]+ ' \
				SHELL=/bin/ksh \
				TERM=sun \
				TMOUT=600 \
				USER=$LOGNAME
				# Set global options
				set -o noclobber -o markdirs +o bgnice
				# Execute commands from the ∼/.logout file on exit
				trap ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.