+# $Id$
+
+
if [ -n "$_home_short_dotbashrc_norc" -o "${TERM#norc-}" != "$TERM" ];then
# We could get executed twice:
export _home_short_dotbashrc_norc=true
fi
if [ -z "$_home_short_dotbashrc" ];then
- _home_short_dotbashrc=true
+ # We permit later reinitialization by unsetting it.
+ # During our execution we forbid spawning to prevent deadlock by:
+ # source /etc/bashrc
+ # . /etc/profile.d/lang.sh
+ # unicode_start iso02.08
+ export _home_short_dotbashrc=true
# $TERM gets restored to its 'norc-' state after ~/.bashrc
# alias norc='TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;"'
function norc { TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;" "$@"; }; export -f norc
function _bash_profile_addpath # <variablename>,<dirpathname>
{
- local _varname _dirpathname _opt_f _opt_s
+ local _varname _varval _varvalold _dirpathname _opt_f _opt_s
_opt_f=0;_opt_s=0
unset OPTIND
while getopts fs got;do
if [ $_opt_s = 1 -o -z "`eval "echo \\${$_varname}"`" ];then
eval "$_varname='$_dirpathname'"
else
- # we want to override any original directories, place dirpathname first!
- eval "$_varname=\"$_dirpathname:\${$_varname}\""
+ # We want to override any original directories, place dirpathname first!
+ # We want to prevent duplicates due to .bashrc reentrancy across fork(2)s.
+ eval "_varval=\":\${$_varname}:\""
+ until [ "$_varval" = "$_varvalold" ];do
+ _varvalold="$_varval"
+ eval "_varval=\"$(echo "$_varval"|sed "s#:$_dirpathname:#:#g")\""
+ done
+ eval "$_varname=\"$_dirpathname$(echo "$_varval"|sed "s#:\$##g")\""
fi
export "$_varname"
}
# /lib/perl for Debian
# /lib/perl5 for Fedora Core
mkdir -p $HOME/lib/perl5 # otherwise CPAN will install to "$HOME/lib/site_perl" etc.
-for _perldir in $(eval "echo {/usr,$HOME}{/lib/perl5,/share/perl,/lib/perl}{,/site_perl}$(
- for perlvar in version archname;do
- echo -n '{,/'
- perl -V:"$perlvar"|cut -d "'" -f 2|tr -d '\n'
- echo -n '}'
- done
- )");do
+_perlpatt="$(perl -MConfig -e 'print "{,/".$Config{$_}."}" for qw(version archname);')"
+for _perldir in $(eval "echo {/usr,$HOME}{/lib/perl5,/share/perl,/lib/perl}{,/site_perl}$_perlpatt");do
_bash_profile_addpath -f PERLLIB "$_perldir"
done
unset _perldir
alias vi='vim'
alias grepb='grep --binary-files=binary'
alias L='lynx'
+alias cvs2cl='cvs2cl --window 3600 --separate-header --no-wrap'
alias cvsfiles='cvsutil --files --print'
alias cvsignores='cvsutil --ignores --print'
alias cvsignoresall='cvsutil --ignores --workings --print'
alias cvsignoresrmall='cvsutil --ignores --workings --rm'
alias cvsignoresallrm='cvsutil --ignores --workings --rm'
[ "`uname`" = "SunOS" -a -x $HOME/bin/rpm-by-pkg ] && alias rpm='rpm-by-pkg'
+alias rpmdb='rpm --define "_dbpath `echo /usr/lib/rpmdb/*/*`"'
+
+# '2>/dev/null' to prevent: unalias: x: not found
+unalias 2>/dev/null cp # -i
+unalias 2>/dev/null mv # -i
+unalias 2>/dev/null rm # -i
+unalias 2>/dev/null df # -h
+unalias 2>/dev/null du # -h
export IGNOREEOF=10
# '2>/dev/null' to prevent: TMOUT: readonly variable
export WWW_HOME="file://$HOME/"
[ -r $file ] && export WWW_HOME="file://$file"
done
-export GREP_OPTIONS="--binary-files=without-match --directories=skip"
+export GREP_OPTIONS="--binary-files=without-match --directories=skip --exclude=tags --exclude=TAGS --exclude=CVS"
if [ -n "$PS1" ];then # set only in interactive sessions
export PS1='[bash]${LOGNAME}@${HOSTNAME}:${PWD}# '
export PS1='\[\017\]'"$PS1" # \017=std charmap
function mkcd { mkdir -p "$1"; cd "$1"; }; export -f mkcd
function pushdmk { mkdir -p "$1"; pushd "$1"; }; export -f pushdmk
function rsync {(unset rsync; rsync -v -e ssh --progress --stats --partial --block-size=512 "$@"; );}; export -f rsync
-function tohex { od -An -txC /tmp/out|tr -d '\n '|tr 'a-f' 'A-F';echo; }; export -f tohex
+function tohex { od -An -txC|tr -d '\n '|tr 'a-f' 'A-F';echo; }; export -f tohex
function edall {
find -type f|while read -r i;do
(awk </dev/null 'BEGIN{ for (i=1;i<ARGC;i++) print ARGV[i]; }' "$@";echo -e 'w\nq')|ed -s "$i"
); };export -f mi
function ctags {(unset ctags;
if [ $# -ne 0 -a '(' $# -ne 1 -o "$1" '!=' "--c-types=+px" ')' ];then ctags "$@";else
- find -type f -a '(' -false \
+ find -type f -a '!' -name tags -a '!' -name TAGS -a '(' -false \
-o -name "*.[chC]" \
-o -name "*.cc" \
-o -name "*.java" \
function exx { cd "`unset exx;exx "$@"|tee /proc/self/fd/2|tail -n1|sed -n 's/^extdir=//p'`"; };export -f exx
function revlines { perl -e 'my @r=();push @r,$_ while (<>);print pop @r while @r;'; }; export -f revlines
-ulimit -c 0
+ulimit -S -c 0
set +H
shopt -s mailwarn
unset OPTIND