--- share/skel/Makefile +++ share/skel/Makefile @@ -3,7 +3,7 @@ FILESGROUPS= FILES1 FILES2 FILES1= dot.cshrc dot.login dot.login_conf dot.mailrc dot.profile \ - dot.shrc + dot.shrc dot.bashrc FILES2= dot.mail_aliases dot.rhosts FILES1DIR= /usr/share/skel FILES2DIR= /usr/share/skel --- share/skel/dot.bashrc +++ share/skel/dot.bashrc @@ -0,0 +1,44 @@ +. /etc/sh.shrc + +alias j='jobs -l' +alias ls='ls -ksF' +alias l='ls -al' +alias cp='cp -ip' +alias mv='mv -i' +alias rm='rm -i' +alias z='suspend' +alias pu='pushd' +alias po='popd' +#alias ripe='whois -h info.ripe.net ' +#alias nsf='whois -h prdb.merit.edu ' + +if [ "${BASH}" ]; then + alias h='history 100' +else + set -V +fi + +PS1=`hostname -s` +case `id -u` in +0) + if [ "${BASH}" ]; then + set prompt3="may be %B%R (y|n|e)?%b" + set prompt2="%B(%h)%R\*%b" + export PS1='\[\]$?\[\]\h\w(\!)#\[\]' + else + export PS1="${PS1}#" + fi + ;; +*) + if [ "${BASH}" ]; then + set prompt3="may be %B%R (y|n|e)?%b" + set prompt2="%B(%h)%R\*%b" + export PS1='\[\]$?\[\]\h\w(\!)>\[\]' + else + export PS1="${PS1}>" + fi + ;; +esac + +# search path for cd(1) +# CDPATH=.:$HOME --- share/skel/dot.login +++ share/skel/dot.login @@ -5,4 +5,35 @@ # see also csh(1), environ(7). # -[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips +if ($?prompt) then + /bin/sh -c '/bin/stty < `/usr/bin/tty` > /dev/null' + eval `tset -Q \?$TERM` + stty crt erase ^H -istrip cs8 intr '^c' kill '^u' eof '^d' >& /dev/null + #stty lnext '^V' cyrill '^n' >& /dev/null + + switch ( "$TERM" ) + case vt340: + case vt220: + case vt100: + case wyse99: + case wyse85: + case xterm: + case decansi: + stty erase '^?' + endsw +endif + +if ( `/usr/bin/tty | /usr/bin/grep 'ttyv'` != "" ) then + vidcontrol -r black red brown black +endif + +if ( $?autologout ) then +# unset autologout +endif + +# Allow terminal messages +mesg yes +# Read system messages +msgs -f + +# [ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips --- share/skel/dot.shrc +++ share/skel/dot.shrc @@ -7,41 +7,30 @@ # # see also sh(1), environ(7). # +. /etc/sh.shrc +alias j='jobs -l' +alias ls='ls -ksF' +alias l='ls -al' +alias cp='cp -ip' +alias mv='mv -i' +alias rm='rm -i' +alias z='suspend' +alias pu='pushd' +alias po='popd' +#alias ripe='whois -h info.ripe.net ' +#alias nsf='whois -h prdb.merit.edu ' + +# set prompt +case $- in *i*) + if [ `id -u` = 0 ] + then export PS1="`id -un`@`hostname -s`#" + else export PS1="`id -un`@`hostname -s`$" + fi -# file permissions: rwxr-xr-x -# -# umask 022 + set -V +esac -# Enable the builtin emacs(1) command line editor in sh(1), -# e.g. C-a -> beginning-of-line. -set -o emacs - -# Uncomment this and comment the above to enable the builtin vi(1) command -# line editor in sh(1), e.g. ESC to go into visual mode. -# set -o vi - - -# some useful aliases -alias h='fc -l' -alias j=jobs -alias m=$PAGER -alias ll='ls -laFo' -alias l='ls -l' -alias g='egrep -i' - -# # be paranoid -# alias cp='cp -ip' -# alias mv='mv -i' -# alias rm='rm -i' - - -# # set prompt: ``username@hostname$ '' -# PS1="`whoami`@`hostname | sed 's/\..*//'`" -# case `id -u` in -# 0) PS1="${PS1}# ";; -# *) PS1="${PS1}$ ";; -# esac # search path for cd(1) # CDPATH=.:$HOME --- share/skel/dot.cshrc +++ share/skel/dot.cshrc @@ -6,38 +6,73 @@ # more examples available at /usr/share/examples/csh/ # -alias h history 25 -alias j jobs -l -alias la ls -aF -alias lf ls -FA -alias ll ls -lAF - -# A righteous umask -umask 22 - -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) - -setenv EDITOR vi -setenv PAGER more -setenv BLOCKSIZE K +alias h history 100 +alias j jobs -l +alias ls ls -ksF +alias l ls -al +alias cp cp -ip +alias mv mv -i +alias rm rm -i +alias z suspend +alias pu pushd +alias po popd +#alias ripe 'whois -h whois.ripe.net ' +#alias nsf 'whois -h prdb.merit.edu ' + +if ( -d /var/mail ) then + set mail=( 10 /var/mail/${user} ) +else + set mail=( 60 /usr/spool/mail/${user} ) +endif if ($?prompt) then - # An interactive shell -- set some stuff up - set prompt = "%N@%m:%~ %# " - set promptchars = "%#" - set filec - set history = 1000 - set savehist = (1000 merge) - set autolist = ambiguous - # Use history to aid expansion - set autoexpand - set autorehash - set mail = (/var/mail/$USER) - if ( $?tcsh ) then - bindkey "^W" backward-delete-word - bindkey -k up history-search-backward - bindkey -k down history-search-forward - endif +# setenv crt 24 +endif +set color="" +set bold="" +set norm="" +setenv PS1 `hostname -s` +setenv | grep '^TERMCAP=' | grep ':Co#' >& /dev/null +if ( ${status} )then +else + set donocolor=${status} endif + +if($?COLORTERM)then + set donocolor=0 +endif + +switch ( "$TERM" ) +case xterm: +case cons*: +case vt220: + set donocolor=0 +endsw + +if( ${donocolor} )then +else + switch (`id -u`) + case 0: + set color="" + breaksw + default: + set color="" + endsw + set bold="" + set norm="" +endif + +if($?tcsh)then + set prompt3="may be %B%R (y|n|e)?%b" + set prompt2="%B(%h)%R\*%b" + set prompt="%{${color}%}%?%B%m%~(%h)%#%b%{${norm}%}" +else + set prompt="${color}${bold}${PS1}(!)>${norm}" +endif +setenv PS1 ${color}${bold}${PS1}\$${norm} + +# search path for cd(1) +#setenv CDPATH .:$HOME + --- share/skel/dot.profile +++ share/skel/dot.profile @@ -5,20 +5,19 @@ # see also sh(1), environ(7). # -# remove /usr/games if you want -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH +case $- in *i*) + /bin/stty < `/usr/bin/tty` > /dev/null + eval `/usr/bin/tset -Qs \?${TERM}` + stty crt erase ^H -istrip cs8 intr '^c' kill '^u' eof '^d' +# stty lnext '^V' cyrill '^n' >& /dev/null -# Setting TERM is normally done through /etc/ttys. Do only override -# if you're sure that you'll never log in via telnet or xterm or a -# serial line. -# Use cons25l1 for iso-* fonts -# TERM=cons25; export TERM +case ${TERM} in + vt340|vt220|vt100|wyse99|wyse85|xterm|decansi) + stty erase '^?';; + cons25|cons30|cons50|cons60) + vidcontrol -r black red brown black;; +esac +esac -BLOCKSIZE=K; export BLOCKSIZE -EDITOR=vi; export EDITOR -PAGER=more; export PAGER -# set ENV to a file invoked each time sh is started for interactive use. -ENV=$HOME/.shrc; export ENV - -[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips +#[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips