1 # This file contains aliases that extend the set of commands available
2 # to the interactive shell user in Unix. They are personally tailored.
4 if [ ! -z "$SHELL_DEBUG" ]; then
5 echo specialized alias initialization begins...
8 # define our functions for use in the shell.
9 source "$SHELLDIR/core/functions.sh"
11 # Standard CAK aliases that add to or extend Unix commands.
12 alias bye='. $SHELLDIR/core/goodbye.sh'
14 alias cls='clear_colormap; clear'
15 if [ "$OS" != "Windows_NT" ]; then
16 if [ -n "$IS_DARWIN" ]; then
19 elif [ ! -z "$(which nautilus)" ]; then
22 #check if konqueror exists also? fall back to uhhh midnight cmdr?
26 alias explorer="bash $SHELLDIR/winders/exploder.sh"
27 alias exp="bash $SHELLDIR/winders/exploder.sh"
30 alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
32 if [ "$OS" = "Windows_NT" ]; then
33 # aliases we only use on the winders side.
37 # su function: makes su perform a login.
38 # for some OSes, this transfers the X authority information to the new login.
40 # decide if we think this is debian or ubuntu or a variant.
41 DEBIAN_LIKE=$(if [ ! -z "$(grep -i debian /etc/issue)" \
42 -o ! -z "$(grep -i ubuntu /etc/issue)" ]; then echo 1; else echo 0; fi)
44 if [ $DEBIAN_LIKE -eq 1 ]; then
45 # debian currently requires the full version which imports X authority
48 # get the x authority info for our current user.
49 source $SHELLDIR/x_win/get_x_auth.sh
51 if [ -z "$X_auth_info" ]; then
52 # if there's no authentication info to pass along, we just do a normal su.
55 # under X, we update the new login's authority info with the previous
57 (unset XAUTHORITY; /bin/su -l $* -c "$X_auth_info ; export DISPLAY=$DISPLAY ; bash")
60 # non-debian supposedly doesn't need the extra overhead any more.
61 # or at least suse doesn't, which is the other one we've tested on.
65 # relabel the console after returning.
66 bash $SHELLDIR/tty/label_terminal_with_infos.sh
69 # sudo function wraps the normal sudo by ensuring we replace the terminal
70 # label if they're doing an su with the sudo.
72 local first_command="$1"
74 if [ "$first_command" == "su" ]; then
75 # yep, they were doing an su, but they're back now.
76 bash $SHELLDIR/tty/label_terminal_with_infos.sh
80 alias whereami='echo whoa dude, try not to think about it...'
82 # buntar is a long needed uncompressing macro that feeds into tar -x.
83 # it takes a list of bz2 file names and extracts their contents into
84 # sequentially numbered directories.
89 pushd buntar_$index &>/dev/null
91 # if the filename has no directory component, we will assume it used to
92 # be above our unzipping directory here.
93 if [ "$(basename $file)" = $file ]; then
96 bunzip2 -d -c $file | tar -xf -
98 index=$(expr $index + 1)
102 # trashes the .#blah files that cvs and svn leave behind when finding conflicts.
103 # this kind of assumes you've already checked them for any salient facts.
104 function clean_cvs_junk {
106 find $i -follow -type f -iname ".#*" -exec perl $SHELLDIR/files/safedel.pl {} ";"
110 # call the generated aliases file, if it exists.
111 if [ -f "$GENERADIR/p_alias.sh" ]; then
112 if [ ! -z "$SHELL_DEBUG" ]; then echo launching generated aliases.; fi
113 source $GENERADIR/p_alias.sh
114 if [ ! -z "$SHELL_DEBUG" ]; then echo done with generated aliases.; fi
117 # remove the fredization macro if it was defined, helping to avoid running
118 # the shell scripts twice for users like root that don't always load this
120 unalias fredme >/dev/null 2>&1
122 if [ ! -z "$SHELL_DEBUG" ]; then echo aliases initialization ends....; fi