zsh: in-progress removing bad aliases

This commit is contained in:
PowerUser64 2021-11-15 02:03:36 -08:00
parent 66e2791e80
commit 38727a311d

21
.zshrc
View file

@ -166,22 +166,25 @@
# <<<
# optionally source an external alias file
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
}
# # TODO: remove all aliases that refrence programs which do not exist >>>
# alias fdsa=not_an_alias
# alias fdsa=not_an_alias # test alias
# alias what='which ' # this will return 0 if something we give it cannot be executed
# validate_alias() {
# echo "validating alias $1"
# if alias "$1";then
# validate_alias ${1}
# else
# what "$1"
# }
# for ALIAS in $(alias | cut -d = -f 1);do
# ! validate_alias "$ALIAS" &&
# # what fdsa
# # may need to use xargs
# for ALIAS in $(alias | cut -d = -f 1);do # assumes you don't have = signs in your alias's names
# echo "validating alias $ALIAS"
# what "$ALIAS" &&
# unalias "$ALIAS" &&
# echo "alias $ALIAS was removed"
# done # <<<
# done
# alias q=exit
# # <<<
}
# <<<
### Functions >>>
{