11 [ "`type -t ls`" = alias ] && unalias ls
12 [ "`type -t ll`" = alias ] && unalias ll
13 [ "`type -t mc`" = alias ] && unalias mc
15 back() { cd - ${1:+"$@"}; }
16 clo() { clear; logout; }
17 eval 'functions() { typeset -f ${1:+"$@"}; }'
20 if [ -z "$BASH_COMPLETION_COMPAT_DIR" ]; then
21 if [ "$SHELL" = /bin/bash ]; then
22 if [ -f /etc/bash_completion ]; then
23 . /etc/bash_completion
24 elif [ -d /etc/bash_completion.d ]; then
25 . /etc/bash_completion.d/*
27 elif [ "$SHELL" = /usr/local/bin/bash ]; then
28 if [ -d /usr/local/etc/bash_completion.d ]; then
29 . /usr/local/etc/bash_completion.d/*
32 echo "Unknown OS type, canot source bash_completion" >&2
36 if [ -z "$BASH_COMPLETION_COMPAT_DIR" ]; then
37 complete -A command -o default man
40 complete -A command -o default builtin cgmem_nice command dbus-launch exec \
41 killall nice nohup pidof pidOf KillAll pgrep pkill psg pswg su sudo time \
42 whence whereis which xargs
43 complete -A hostname dig host nslookup nc netcat nmap p ping ping6 socat \
45 tcptraceroute tcptraceroute6 tracert tracert6 traceroute traceroute6 \
46 whois wget wget-m wget-wrapper ww
47 complete -A hostname -o default distribute ftp lftp r rsync \
48 s scp ssh smbclient tcpdump tshark wireshark
49 complete -A job bg fg j jobs wait
50 complete -A variable unset
52 if [ -d "$HOME/lib/config" ]; then
53 complete -W "`cd \"$HOME/lib/config\" && echo *`" include
55 complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser
59 back() { cd - ${1:+"$@"}; }
60 clo() { clear; exit; }
65 clo() { clear; exit; }
70 # clear history, clear screen and logout
71 #chlo() { cd; unset HISTFILE; rm -f .*history*; clo; }
74 #Pwd() { pwd | sed "s/.*\/\(.*\)\/\(.*\)\/\(.*\)\/\(.*\)/...\/\2\/\3\/\4/"; }
75 #PWd() { pwd | sed "s/.*\/\(.*\)\/\(.*\)/...\/\2/"; }
78 psg() { ps auxw | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\)'; }
79 pswg() { ps auxwww | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\)'; }
82 pidOf() { ps auxwww | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\|pidOf\|KillAll\)' | awk '{print $2}'; }
89 kill "$1" `pidOf "$2"`
95 X() { startx >> .Xserver.log 2>&1; cyr; }
101 if [ -f "./$cfg" -a -r "./$cfg" ]; then
102 echo "Reading config file \`$cfg'" 1>&2
104 elif [ -f "$HOME/lib/config/$cfg" -a -r "$HOME/lib/config/$cfg" ]; then
105 echo "Reading config file \`$HOME/lib/config/$cfg'" 1>&2
106 . "$HOME/lib/config/$cfg"
108 echo "Cannot find config file \`$cfg'" 1>&2
114 if [ -n "$SLOWTERM" ]; then
119 screen*) # screen, screen.rxvt
120 if [ "$TERM" = screen.rxvt ]; then
134 /usr/local/share/mc/bin/mc-wrapper.sh \
135 /usr/local/libexec/mc/mc-wrapper.sh \
136 /usr/share/mc/bin/mc-wrapper.sh; do
137 if [ -r $wrapper ]; then
138 . $wrapper $MC_SLOW $MC_XTERM "$@"
145 if [ $MC_FOUND = NO ]; then
146 for mc in /usr/local/bin/mc /usr/bin/mc; do
148 MC_TMP_DIR="${TMPDIR-/tmp}/mc-$USER"
149 if [ ! -d MC_TMP_DIR="${TMPDIR-/tmp}/mc-$USER" ]; then
150 MC_TMP_DIR="${TMPDIR-/tmp}"
152 MC_PWD_FILE="$MC_TMP_DIR/mc.pwd.$$"
153 mc_type="`mc_type.py $mc`"
154 if [ "$mc_type" = old ]; then
155 $mc -P $MC_SLOW $MC_XTERM "$@" > "$MC_PWD_FILE"
156 elif [ "$mc_type" = new ]; then
157 $mc -P "$MC_PWD_FILE" $MC_SLOW $MC_XTERM "$@"
163 cd "`cat \"$MC_PWD_FILE\"`" && /bin/rm "$MC_PWD_FILE"
169 if [ $MC_FOUND = NO ]; then
170 echo "Cannot find mc-wrapper.sh or mc" >&2
174 [ -n "$MC_SAVE_TERM" ] && TERM="$MC_SAVE_TERM"
175 unset MC_FOUND MC_PWD_FILE MC_SAVE_TERM MC_SLOW MC_TMP_DIR MC_XTERM