Last active
January 31, 2022 10:13
-
-
Save Thesola10/687a1f1cddbf5d904e37c72430cec402 to your computer and use it in GitHub Desktop.
sudo make me a sandwich
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 | |
# make-sandwich by Karim Vergnes <me@thesola.io> | |
# XKCD/149-compliant wrapper for Make | |
# License: WTFPL 1.0 | |
# Requires make to work. To install, place in /usr/local/bin/ | |
if ! which /usr/bin/make > /dev/null 2>&1 | |
then | |
echo "make is not installed. See your distribution's info to install it." | |
exit 3 | |
fi | |
if [[ "$1" == "sandwich" ]] | |
then | |
[[ $UID == 0 ]] && { echo -e "Okay.\n(A sandwich appeared in /var/lib/sandwich)"; echo "From make with love :)" >> /var/lib/sandwich; exit 0; } \ | |
|| { echo "What? Make it yourself."; exit 1; } | |
else | |
/usr/bin/make $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment