zsh: in-progress removing bad aliases
This commit is contained in:
parent
66e2791e80
commit
38727a311d
1 changed files with 18 additions and 15 deletions
33
.zshrc
33
.zshrc
|
@ -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
|
||||
# validate_alias() {
|
||||
# echo "validating alias $1"
|
||||
# if alias "$1";then
|
||||
# validate_alias ${1}
|
||||
# else
|
||||
# }
|
||||
# for ALIAS in $(alias | cut -d = -f 1);do
|
||||
# ! validate_alias "$ALIAS" &&
|
||||
# unalias "$ALIAS" &&
|
||||
# echo "alias $ALIAS was removed"
|
||||
# done # <<<
|
||||
|
||||
}
|
||||
|
||||
# # TODO: remove all aliases that refrence programs which do not exist >>>
|
||||
# alias fdsa=not_an_alias # test alias
|
||||
# alias what='which ' # this will return 0 if something we give it cannot be executed
|
||||
# validate_alias() {
|
||||
# what "$1"
|
||||
# }
|
||||
# # 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
|
||||
# alias q=exit
|
||||
# # <<<
|
||||
|
||||
# <<<
|
||||
### Functions >>>
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue