blob: 2d8d37b6ea92891b7d1d4e7be649349f655c6ee6 [file] [log] [blame]
Chet Ramey495aee42011-11-22 19:11:26 -05001case $- in
2*i*) ;;
3*) return ;;
4esac
Jari Aalto726f6381996-08-26 18:22:31 +00005
Jari Aaltoccc6cda1996-12-23 17:02:34 +00006# bogus
7if [ -f /unix ] ; then
8 alias ls='/bin/ls -CF'
9else
10 alias ls='/bin/ls -F'
11fi
12alias ll='ls -l'
13alias dir='ls -ba'
14
Jari Aalto726f6381996-08-26 18:22:31 +000015alias ss="ps -aux"
Jari Aaltoccc6cda1996-12-23 17:02:34 +000016alias dot='ls .[a-zA-Z0-9_]*'
17alias news="xterm -g 80x45 -e trn -e -S1 -N &"
18
Jari Aalto726f6381996-08-26 18:22:31 +000019alias c="clear"
20alias m="more"
21alias j="jobs"
22
Jari Aaltoccc6cda1996-12-23 17:02:34 +000023# common misspellings
24alias mroe=more
25alias pdw=pwd
26
27hash -p /usr/bin/mail mail
28
Jari Aalto726f6381996-08-26 18:22:31 +000029if [ -z "$HOST" ] ; then
Jari Aaltoccc6cda1996-12-23 17:02:34 +000030 export HOST=${HOSTNAME}
Jari Aalto726f6381996-08-26 18:22:31 +000031fi
32
Jari Aaltoccc6cda1996-12-23 17:02:34 +000033HISTIGNORE="[ ]*:&:bg:fg"
Jari Aalto726f6381996-08-26 18:22:31 +000034
35psgrep()
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
44pskill()
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
54term()
55{
56 TERM=$1
57 export TERM
58 tset
59}
60
Jari Aaltoccc6cda1996-12-23 17:02:34 +000061xtitle ()
62{
63 echo -n -e "\033]0;$*\007"
64}
65
Jari Aalto726f6381996-08-26 18:22:31 +000066cd()
67{
Jari Aaltoccc6cda1996-12-23 17:02:34 +000068 builtin cd "$@" && xtitle $HOST: $PWD
Jari Aalto726f6381996-08-26 18:22:31 +000069}
70
71bold()
72{
73 tput smso
74}
75
76unbold()
77{
78 tput rmso
79}
80
81if [ -f /unix ] ; then
82clear()
83{
84 tput clear
85}
86fi
87
88rot13()
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
97watch()
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#
109rl()
110{
111 rlogin $* -8
112}
113
114function setenv()
115{
116 if [ $# -ne 2 ] ; then
117 echo "setenv: Too few arguments"
118 else
119 export $1="$2"
120 fi
121}
122
123function 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}