Skip to content

Instantly share code, notes, and snippets.

@rnelson
Last active November 16, 2015 23:42
Show Gist options
  • Save rnelson/9138125 to your computer and use it in GitHub Desktop.
Save rnelson/9138125 to your computer and use it in GitHub Desktop.
fuck you, program!

About

Need to kill a program? Make it fun.

$ fuck you firefox
(╯°□°)╯ firefox
$

This script uses pkill. It should work on OS X and probably NetBSD, FreeBSD, and Solaris. It looks like at least some Linux distributions also include a Solaris-compatible pkill, so it may work there too. YMMV.

It also uses bash. Alternatives exist for Windows, fish, and zsh.

Shamelessly stolen from this tweet.

Installation

Run the following command in your shell:

curl https://gist.githubusercontent.com/rnelson/9138125/raw/fuckyou.sh | bash

You'll have to log out and back in (or close and reopen your Terminal/iTerm/whatever) for $PATH to be picked up automatically. Alternatively, you can force your shell to reread the path:

$ . .bash_profile
#!/bin/bash
# fuck you, program!
# If ~/bin doesn't exist, make that first
if [ ! -d ~/bin ]; then
mkdir ~/bin
fi
# If they already have a ~/bin/fuck for some reason, move
# that out of the way and inform the user
if [ -x ~/bin/fuck ]; then
mv ~/bin/fuck ~/bin/fuck.bak.fuckyoufirefox
echo "Moved ~/bin/fuck to ~/bin/fuck.bak.fuckyoufirefox"
fi
# Add ~/bin to the user's $PATH
echo "export PATH=\$PATH:~/bin" >> ~/.bash_profile
# Create ~/bin/fuck
cat >~/bin/fuck <<EOF
#!/bin/bash
# fuck you, program!
# stolen from https://twitter.com/louroboros/status/412913768998268928
if [ -z "\$2" ]; then
echo "usage: fuck you <program>"
else
if pkill "\$2"; then
echo "(╯°□°)╯ $(echo \$2)"
else
echo "\$2 doesn't appear to be running"
fi
fi
EOF
# Make it executable
chmod +x ~/bin/fuck
# Done
echo "Installation complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment