Skip to content

Instantly share code, notes, and snippets.

@Thesola10
Last active January 31, 2022 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thesola10/687a1f1cddbf5d904e37c72430cec402 to your computer and use it in GitHub Desktop.
Save Thesola10/687a1f1cddbf5d904e37c72430cec402 to your computer and use it in GitHub Desktop.
sudo make me a sandwich
#!/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