]> git.ipfire.org Git - thirdparty/bash.git/blob - examples/startup-files/bashrc
Bash-4.2 distribution sources and documentation
[thirdparty/bash.git] / examples / startup-files / bashrc
1 case $- in
2 *i*) ;;
3 *) return ;;
4 esac
5
6 # bogus
7 if [ -f /unix ] ; then
8 alias ls='/bin/ls -CF'
9 else
10 alias ls='/bin/ls -F'
11 fi
12 alias ll='ls -l'
13 alias dir='ls -ba'
14
15 alias ss="ps -aux"
16 alias dot='ls .[a-zA-Z0-9_]*'
17 alias news="xterm -g 80x45 -e trn -e -S1 -N &"
18
19 alias c="clear"
20 alias m="more"
21 alias j="jobs"
22
23 # common misspellings
24 alias mroe=more
25 alias pdw=pwd
26
27 hash -p /usr/bin/mail mail
28
29 if [ -z "$HOST" ] ; then
30 export HOST=${HOSTNAME}
31 fi
32
33 HISTIGNORE="[ ]*:&:bg:fg"
34
35 psgrep()
36 {
37 ps -aux | grep $1 | grep -v grep
38 }
39
40 #
41 # This is a little like `zap' from Kernighan and Pike
42 #
43
44 pskill()
45 {
46 local pid
47
48 pid=$(ps -ax | grep $1 | grep -v grep | awk '{ print $1 }')
49 echo -n "killing $1 (process $pid)..."
50 kill -9 $pid
51 echo "slaughtered."
52 }
53
54 term()
55 {
56 TERM=$1
57 export TERM
58 tset
59 }
60
61 xtitle ()
62 {
63 echo -n -e "\033]0;$*\007"
64 }
65
66 cd()
67 {
68 builtin cd "$@" && xtitle $HOST: $PWD
69 }
70
71 bold()
72 {
73 tput smso
74 }
75
76 unbold()
77 {
78 tput rmso
79 }
80
81 if [ -f /unix ] ; then
82 clear()
83 {
84 tput clear
85 }
86 fi
87
88 rot13()
89 {
90 if [ $# = 0 ] ; then
91 tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]"
92 else
93 tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" < $1
94 fi
95 }
96
97 watch()
98 {
99 if [ $# -ne 1 ] ; then
100 tail -f nohup.out
101 else
102 tail -f $1
103 fi
104 }
105
106 #
107 # Remote login passing all 8 bits (so meta key will work)
108 #
109 rl()
110 {
111 rlogin $* -8
112 }
113
114 function setenv()
115 {
116 if [ $# -ne 2 ] ; then
117 echo "setenv: Too few arguments"
118 else
119 export $1="$2"
120 fi
121 }
122
123 function chmog()
124 {
125 if [ $# -ne 4 ] ; then
126 echo "usage: chmog mode owner group file"
127 return 1
128 else
129 chmod $1 $4
130 chown $2 $4
131 chgrp $3 $4
132 fi
133 }