From 38727a311d4dcc0b953ce7ebe5ab0e30be7309cc Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Mon, 15 Nov 2021 02:03:36 -0800 Subject: [PATCH] zsh: in-progress removing bad aliases --- .zshrc | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.zshrc b/.zshrc index cbd8d12..a3c6687 100644 --- a/.zshrc +++ b/.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 >>> {