chiark / gitweb /
Silly emacs files
[ian-dotfiles.git] / files / _.bashrc
1 # Ian Jackson's shell rc
2
3 hostname_completion_file=~/.hosts 
4
5 export PWD
6
7 # My own functions
8 ls() { /bin/ls -FC "$@" ; }
9 ll() { /bin/ls -FClag "$@" ; }
10 setprompt() { PS1=`autotitle`; export PS1; }
11 rs() { eval `/usr/openwin/bin/resize` ; setprompt ; }
12 cd() { builtin cd "$@"; setprompt; }
13 pu() { builtin pushd "$@"; setprompt; }
14 po() { builtin popd "$@"; setprompt; }
15
16 # newgrp() { 
17 #       NEWGRPSHELL="${LOGINSHELL:-}"; export NEWGRPSHELL
18 #       exec /bin/newgrp $*
19 # }
20
21 setenv () {
22         varname=`echo $1 | tr '[a-z]' '[A-Z]'`
23         eval "$varname=\"$2\"" ; export $varname ;
24 }
25
26 # if [ "${NEWGRPSHELL:-}" ]
27 # then
28 #       unset NEWGRPSHELL
29 #       LOGINSHELL=true
30 # fi
31
32 # Set up history and prompt
33 if [ "$PS1" ]
34 then
35         HISTFILE=$HOME/.history/$HOST~$$~
36         AUTOTITLE_STDOUT="${LOGINSHELL:+-}%?u%U%!%?g(%G)%!%?u@%!%h:%d1~.> "
37         AUTOTITLE_WINDOW="%h - %d~. %Y.[U..[M..[D./..%X.L]..M]..R]./.. %U%?G(%G)%!"
38         AUTOTITLE_ICON="%h: %d3~. %Y.[U..[M..[D./..%X.L]..M]..R]./.."
39         export AUTOTITLE_STDOUT AUTOTITLE_WINDOW AUTOTITLE_ICON
40         setprompt
41 fi
42
43 # Set up the terminal:
44 # stty new intr '^c' erase '^?' kill '^x' susp '^z' dsusp '^y' eof '^d' \
45 #      hupcl ixon ixoff -tostop quit '^\' 2>/dev/null