[ "`type -t ls`" = alias ] && unalias ls
[ "`type -t ll`" = alias ] && unalias ll
-functions() { typeset -f "$@"; }
+alias functions='typeset -f'
if [ -r "$HOME"/admin/prog/bash_prompt ]; then
. "$HOME"/admin/prog/bash_prompt
if test -x /usr/bin/screen >/dev/null 2>&1; then
- screen_newwin() {
- history -a
- screen "$@"
- }
+ alias screen_newwin='history -a; screen'
fi
-if [ "$SHLVL" -eq 1 -a "`type -t X`" = function ] && which startx >/dev/null 2>&1; then
- # From https://stackoverflow.com/a/18839557
+if [ "$SHLVL" -eq 1 ] && which startx >/dev/null 2>&1; then
+ case "`type -t X`" in
+ alias)
+ alias _non_bash_X="`alias X | sed -e \"s/^alias X='//\" -e \"s/'\$//\"`"
+ alias X='history -a; _non_bash_X; history -r'
+ ;;
- copy_function() {
- test -n "$(declare -f "$1")" || return
- eval "${_/$1/$2}"
- }
+ function)
+ # From https://stackoverflow.com/a/18839557
- rename_function() {
- copy_function "$@" || return
- unset -f "$1"
- }
+ copy_function() {
+ test -n "$(declare -f "$1")" || return
+ eval "${_/$1/$2}"
+ }
- rename_function X _non_bash_X
+ rename_function() {
+ copy_function "$@" || return
+ unset -f "$1"
+ }
- X() { history -a; _non_bash_X; history -r; }
+ #rename_function X _non_bash_X
+
+ #X() { history -a; _non_bash_X; history -r; }
+ ;;
+ esac
fi
esac
if test -n "$KSH_VERSION" -o -n "$FCEDIT"; then
- back() { cd - "$@"; }
+ alias back='cd -'
alias j=jobs
fi
if [ "$SHLVL" -eq 1 ] && which startx >/dev/null 2>&1; then
- X() { startx >> .Xserver.log 2>&1; cyr; /bin/rm -f .Xauthority; }
+ alias X='startx >> .Xserver.log 2>&1; cyr; /bin/rm -f .Xauthority'
fi
alias x='logout || exit'