فهرست منبع

reduce global Bash profile to the bare minimum which is always ok to configure without nasty side-effects. Everything else has to be done by the user explicitly (or through OSSP due in the near future)

Ralf S. Engelschall 21 سال پیش
والد
کامیت
0664a9661b
2فایلهای تغییر یافته به همراه6 افزوده شده و 89 حذف شده
  1. 1 1
      bash/bash.spec
  2. 5 88
      bash/profile

+ 1 - 1
bash/bash.spec

@@ -40,7 +40,7 @@ Class:        CORE
 Group:        Shell
 License:      GPL
 Version:      %{V_base_real}.%{V_plvl_raw}
-Release:      20040909
+Release:      20041023
 
 #   list of sources
 Source0:      ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}.tar.gz

+ 5 - 88
bash/profile

@@ -2,100 +2,17 @@
 ##  @l_prefix@/etc/bash/profile -- Global GNU Bash Profile
 ##
 
-#   welcome and goodbye message ;)
-echo "$HOSTNAME: user $USER, login at `date`"
-trap 'echo "$HOSTNAME: user $USER, logout at `date`"' 0
-
-#   initially adjust $PWD to symbolic path
-cd $HOME
-
-#   provide user and host information in default prompt
-PS1="\u@\h\$ "
-
-#   session timeout
-export TMOUT=3600
+#   interactive prompt
+if expr $- : ".*i.*" >/dev/null; then
+    PS1="\u@\h\\\$ "
+fi
 
 #   environment permissions
 umask 022
-ulimit -c 16384
-if [ ".$PS1" != . ]; then
-    mesg y 2>/dev/null
-fi
 
 #   history functionality
 shopt -s histappend
 HISTSIZE=100
 HISTFILESIZE=100
-alias h='history | $PAGER'
-
-#   various additional variables
-export TMPDIR=/tmp
-export TEMPDIR=$TMPDIR
-export BLOCKSIZE=1024
-
-#   turn on extended globbing
-shopt -s extglob no_empty_cmd_completion
-
-#   make directory commands see only directories
-complete -d cd mkdir rmdir pushd
-
-#   make file commands see only (their) files
-complete -f cat less more ln strip
-complete -f -X '*.bz2' bzip2
-complete -f -X '!*.bz2' bunzip2
-complete -f -X '!*.zip' unzip
-complete -f -X '*.gz' gzip
-complete -f -X '*.Z' compress
-complete -f -X '!*.+(Z|gz|tgz|Gz)' gunzip zcat zmore
-complete -f -X '!*.Z' uncompress zmore zcat
-complete -f -X '!*.+(gif|jpg|jpeg|GIF|JPG|bmp)' xv display
-complete -f -X '!*.+(ps|PS|ps.gz)' gv gs mgv
-complete -f -X '!*.+(dvi|DVI)' dvips xdvi
-complete -f -X '!*.+(pdf|PDF)' acroread xpdf
-complete -f -X '!*.texi*' makeinfo texi2dvi texi2html
-complete -f -X '!*.+(tex|TEX)' tex latex
-complete -f -X '!*.+(c|cc|C|h|hh|H)' cc gcc
-
-#   make signal and job commands see only signals/jobs
-complete -A signal kill -P '%'
-complete -A stopped -P '%' bg
-complete -j -P '%' fg jobs
-
-#   make user/group commands see only users/groups
-complete -u passwd su finger
-complete -u passwd
-
-#   make network commands see only hostnames
-complete -A hostname ssh rsh telnet rlogin ftp ping host traceroute nslookup dig
-
-#   make internal commands see only their possibilities
-complete -v export local readonly unset
-complete -A setopt set
-complete -A shopt shopt
-complete -A helptopic help
-complete -a unalias
-complete -A binding bind
-
-#   convenient root privilege switching
-root () {
-    if [ $# -eq 0 -o ".$1" = ".-i" ]; then
-        ssh -t -x root@localhost cd $PWD \&\& exec ${SHELL-/bin/sh}
-    elif [ ".$1" = ".-l" ]; then
-        ssh -x root@localhost cd $PWD \&\& `history | tail -2 | head -1 | cut -c8-`
-    elif [ ".$1" = ".-t" ]; then
-        shift
-        ssh -t -x root@localhost cd $PWD \&\& "$@"
-    else
-        ssh -x root@localhost cd $PWD \&\& "$@"
-    fi
-}
-
-#   load the Bourne-Shell environment of all installed OpenPKG packages
-eval `@l_prefix@/etc/rc --eval all env`
-
-#   path to user environment init script
-if [ -f "$HOME/.bashrc" ]; then
-    BASH_ENV=$HOME/.bashrc
-    . $BASH_ENV
-fi
+HISTIGNORE="&"