Wasn't that great?! Truly Oscar-worthy. If only we could replicate that utter rage when things go wrong in our terminal. We can, thanks to IHATEYOU.SH!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Needed to provide alias expansion (so we can use those aliases after the script's finished) | |
shopt -s expand_aliases | |
while read x; | |
do | |
a=`echo $x | tr '[:lower:]' '[:upper:]'`; | |
#Added because the script was picking up empty lines | |
if [ "$a" != '' ] | |
then | |
alias $a=$x; | |
fi | |
done < <(compgen -c) |
compgen
to list all of the commands available at the time, then iterates through that list, adding an all-caps alias. These aliases will be local to your shell, so you don't have to worry about screwing up your pretty ~/.bash_aliases
file.To get rid of the aliases, either close the terminal session or apologize with the
youareprettyok.sh
script.
No comments:
Post a Comment