1 if [ -z "$_home_short_dotbashrc" ];then
2 _home_short_dotbashrc=true
4 if [ -f /etc/bashrc ];then source /etc/bashrc;fi
6 function _bash_profile_addpath # variable,dirpathname
8 if [ '!' -d "$2" ];then return;fi
9 if [ -n "$3" -o -z "`eval "echo \\${$1}"`" ];then
12 # we want to override any original directories, place dirpathname first!
13 eval "$1=\"$2:\${$1}\""
18 _bash_profile_addpath PATH "$HOME/bin"
19 _bash_profile_addpath PATH "$HOME/sbin"
20 _bash_profile_addpath LD_LIBRARY_PATH "$HOME/lib"
21 _bash_profile_addpath MANPATH "$HOME/man"
23 _bash_profile_addpath CVSROOT "$HOME/cvs" single
24 _bash_profile_addpath CVSROOT "$HOME/pserver/cvs" single
26 for _perldir in $(eval "echo $HOME/lib/perl5{,/site_perl}$(
27 for perlvar in version archname;do
29 perl -V:"$perlvar"|cut -d "'" -f 2|tr -d '\n'
33 _bash_profile_addpath PERLLIB "$_perldir"
37 unset -f _bash_profile_addpath
41 alias maple="ssh -t vega.fjfi.cvut.cz maple"
42 #alias cc='cc -I/home/short/include'
44 alias grepb='grep --binary-files=binary'
46 alias cvsfiles='cvsutil --files --print'
47 alias cvsignores='cvsutil --ignores --print'
48 alias cvsignoresall='cvsutil --ignores --workings --print'
49 alias cvsignoresrm='cvsutil --ignores --rm'
50 alias cvsignoresrmall='cvsutil --ignores --workings --rm'
51 alias cvsignoresallrm='cvsutil --ignores --workings --rm'
53 weberr="/var/log/httpd/error/klokan.error_log"
54 if [ -f "$weberr" ];then alias weberr='tail "$weberr"';fi
55 weblog="/var/log/httpd/klokan.access_log"
56 if [ -f "$weblog" ];then alias weblog='tail -n 20000 "$weblog"|grep "\\(~\\|%7[eE]\\)short"';fi
61 export LC_CTYPE=cs_CZ.ISO-8859-2
62 export PERL_MM_OPT="PERL=$HOME/bin/perlilib PREFIX=$HOME"
63 export WWW_HOME="file:///home/short/.bookmarks.html"
64 export GREP_OPTIONS="--binary-files=without-match --directories=skip"
65 [ -n "$PS1" ] && export PS1="`echo -en '\017'`$PS1" # set only in interactive sessions
66 export MINICOM="-m -c on" # metakeys+color
67 export HISTSIZE=100000
68 export HISTFILESIZE="$HISTSIZE"
71 # Force strcoll() to sort case-sensitively! (empty/undef doesn't work)
74 function cvsdiff { cvs diff "$@" 2>&1|pipebuf -q| less; }; export -f cvsdiff
75 function cvsdiffi { cvs diff "$@" 2>&1|pipebuf -q|grep -v '^?'|less; }; export -f cvsdiffi
76 function cvsupdate { cvs update "$@" 2>&1|pipebuf -q| less; }; export -f cvsupdate
77 function cvsupdatei { cvs update "$@" 2>&1|pipebuf -q|grep -v '^?'|less; }; export -f cvsupdatei
79 function wclines { awk '{x[$0]++}END{for (i in x) print x[i]"\t"i}'; }; export -f wclines
80 function ulimitme { ulimit -m 100000 -d 150000 -v 200000; }; export -f ulimitme
81 function grep {(unset grep; ( ulimitme; grep "$@"; ); );}; export -f grep
82 function finame { find . -false `
83 awk </dev/null 'BEGIN{ for (i=1;i<ARGC;i++) print " -o -iname *"ARGV[i]"*"; }' "$@";
84 `; }; export -f finame
85 function mkcd { mkdir -p "$1"; cd "$1"; }; export -f mkcd
86 function pushdmk { mkdir -p "$1"; pushd "$1"; }; export -f pushdmk
87 function rsync {(unset rsync; rsync -v -e ssh --progress --stats --partial --block-size=512 "$@"; );}; export -f rsync
88 function tohex { od -An -txC /tmp/out|tr -d '\n '|tr 'a-f' 'A-F';echo; }; export -f tohex
90 find -type f|while read -r i;do
91 (awk </dev/null 'BEGIN{ for (i=1;i<ARGC;i++) print ARGV[i]; }' "$@";echo -e 'w\nq')|ed -s "$i"
95 set -ex;cd "$1";while true;do test "$PWD" != "/";if [ -e configure.in -o -e Makefile.PL ];then break;fi;cd ..;done;make install;
97 function ctags {(unset ctags;
98 if [ $# != 0 ];then ctags "$@";else
99 find -type f -a '(' -name "*.[chC]" -o -name "*.cc" -o -name "*.java" ')'|ctags --file-tags -L -
100 fi; );}; export -f ctags
106 if [ -f "$HOME/.bashrc.local" ];then source "$HOME/.bashrc.local";fi
108 unset _home_short_dotbashrc # permit later reinitializations
109 fi # _home_short_dotbashrc