Upload Tizen:Base source
[external/bash.git] / examples / startup-files / bashrc
1 if [ -z "$PS1" ]; then
2         return
3 fi
4
5 # bogus
6 if [ -f /unix ] ; then  
7         alias ls='/bin/ls -CF'
8 else
9         alias ls='/bin/ls -F'
10 fi
11 alias ll='ls -l'
12 alias dir='ls -ba'
13
14 alias ss="ps -aux"
15 alias dot='ls .[a-zA-Z0-9_]*'
16 alias news="xterm -g 80x45 -e trn -e -S1 -N &"
17
18 alias c="clear"
19 alias m="more"
20 alias j="jobs"
21
22 # common misspellings
23 alias mroe=more
24 alias pdw=pwd
25
26 hash -p /usr/bin/mail mail
27
28 if [ -z "$HOST" ] ; then
29         export HOST=${HOSTNAME}
30 fi
31
32 HISTIGNORE="[   ]*:&:bg:fg"
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 xtitle () 
61
62         echo -n -e "\033]0;$*\007"
63 }
64
65 cd()
66 {
67         builtin cd "$@" && xtitle $HOST: $PWD
68 }
69
70 bold()
71 {
72         tput smso
73 }
74
75 unbold()
76 {
77         tput rmso
78 }
79
80 if [ -f /unix ] ; then
81 clear()
82 {
83         tput clear
84 }
85 fi
86
87 rot13()
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
96 watch()
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 #
108 rl()
109 {
110         rlogin $* -8
111 }
112
113 function setenv()
114 {
115         if [ $# -ne 2 ] ; then
116                 echo "setenv: Too few arguments"
117         else
118                 export $1="$2"
119         fi
120 }
121
122 function 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 }