Adding a function to rc_lib and alias alias_lib

This commit is contained in:
2026-01-13 14:08:37 +04:00
parent cb76533758
commit 27f28fd3fb
2 changed files with 25 additions and 6 deletions

View File

@@ -38,4 +38,18 @@ gpush() {
fi
}
myalias() {
local RED=$(tput setaf 1)
local GREEN=$(tput setaf 2)
local normal=$(tput sgr0)
echo " My custom aliases:"
echo " Alias Command"
echo "--------------------- ---------------------------------"
grep "^alias " ~/.dotfiles/linux/lib/alias_lib | \
sed 's/^alias //;s/="/ /;s/"$//' | \
sort | \
while read -r key command; do
printf " ${RED}%-20s${normal} ${GREEN}%s${normal}\n" "$key" "$command"
done
}