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