5363e58335c463c9b26f416b13dd465ead7e699f
[platform/upstream/bash.git] / examples / startup-files / bashrc
1 if [ "$PS1" != "" ] ; then
2
3 if [ -f /unix ] ; then
4         alias ls='/bin/ls -CF'
5         alias ll='/bin/ls -lCF'
6         alias dir='/bin/ls -bCalF'
7 else
8         alias ls='/bin/ls -F'
9         alias ll='/bin/ls -lF'
10         alias dir='/bin/ls -balF'
11 fi
12
13 alias ss="ps -aux"
14 alias mail=/usr/ucb/mail
15 alias dot='ls .[a-zA-Z0-9]*'
16 alias mroe=more
17 alias pwd='echo $PWD'
18 alias pdw='echo $PWD'
19 alias news="xterm -g 80x45 -e rn -e &"
20 alias back='cd $OLDPWD'
21 alias manroff="nroff /usr/lib/tmac/tmac.an.4.3"
22 alias laser="lpr -Palw2"
23 alias lw="lpr -Palw2"
24 alias c="clear"
25 alias m="more"
26 alias j="jobs"
27
28 if [ -z "$HOST" ] ; then
29         export HOST=`hostname`
30 fi
31
32 history_control=ignoredups
33
34 psgrep()
35 {
36         ps -aux | grep $1 | grep -v grep
37 }
38
39 #
40 # This is a little like `zap' from Kernighan and Pike
41 #
42
43 pskill()
44 {
45         local pid
46
47         pid=$(ps -ax | grep $1 | grep -v grep | awk '{ print $1 }')
48         echo -n "killing $1 (process $pid)..."
49         kill -9 $pid
50         echo "slaughtered."
51 }
52
53 term()
54 {
55         TERM=$1
56         export TERM
57         tset
58 }
59
60 cd()
61 {
62         builtin cd $*
63         xtitle $HOST: $PWD
64 }
65
66 bold()
67 {
68         tput smso
69 }
70
71 unbold()
72 {
73         tput rmso
74 }
75
76 if [ -f /unix ] ; then
77 clear()
78 {
79         tput clear
80 }
81 fi
82
83 rot13()
84 {
85         if [ $# = 0 ] ; then
86                 tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]"
87         else
88                 tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" < $1
89         fi
90 }
91
92 watch()
93 {
94         if [ $# -ne 1 ] ; then
95                 tail -f nohup.out
96         else
97                 tail -f $1
98         fi
99 }
100
101 #
102 #       Remote login passing all 8 bits (so meta key will work)
103 #
104 rl()
105 {
106         rlogin $* -8
107 }
108
109 function setenv()
110 {
111         if [ $# -ne 2 ] ; then
112                 echo "setenv: Too few arguments"
113         else
114                 export $1="$2"
115         fi
116 }
117
118 function chmog()
119 {
120         if [ $# -ne 4 ] ; then
121                 echo "usage: chmog mode owner group file"
122                 return 1
123         else
124                 chmod $1 $4
125                 chown $2 $4
126                 chgrp $3 $4
127         fi
128 }
129
130 #
131 # Source kshenv for ksh-compatibility definitions
132 #
133
134 if [ -f ~/.kshenv ] ; then
135         . ~/.kshenv
136 fi
137
138 fi
139 #end of .bashrc