Anti-Aliasing
Just run this one once, or more often if you’re feeling lucky.
Inspiration for this one came from Jan K.
|
|
What it does
It adds an extra line to the end of the ${HOME}/.bashrc
for every user that
has /bin/bash
as the shell. This line adds an alias for an often used command
to a command that you might want to run when you’re feeling down.
Why it works
This script does the following:
- Line 2 sets a list of commands you want to override.
- Line 3 sets a list of commands you do want to run instead.
- Line 4 sets a list of
.bashrc
locations for all users with/bin/bash
set as their shell. - Line 5 loops over all users found in step 4.
- Lines 6 and 7 select a random original command and a random new command.
- Line 8 adds an alias for the commands from the previous step.
TL;DR
- Predictable commands
- Working system
- Fun