Skip to content

Instantly share code, notes, and snippets.

@rnelson
Last active December 30, 2024 20:57
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.

Revisions

  1. rnelson revised this gist Feb 21, 2014. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -21,10 +21,14 @@ Installation
    ------------
    Run the following command in your shell:

    ```curl https://gist.github.com/rnelson/9138125/raw/fuckyou.sh | bash```
    ```
    curl https://gist.github.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```
    ```
    $ . .bash_profile
    ```
  2. rnelson revised this gist Feb 21, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,11 @@ About
    -----
    Need to kill a program? Make it fun.

    ```$ fuck you firefox
    ```
    $ 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
  3. rnelson revised this gist Feb 21, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,9 @@ 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
  4. rnelson revised this gist Feb 21, 2014. 1 changed file with 26 additions and 1 deletion.
    27 changes: 26 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,28 @@
    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](https://gist.github.com/namuol/9122237/#comment-1176432),
    [fish](https://gist.github.com/namuol/9122237/#comment-1176874), and [zsh](https://gist.github.com/namuol/9122237/#comment-1176934).
    Shamelessly stolen from [this tweet](https://twitter.com/louroboros/status/412913768998268928).
    Installation
    ------------
    `curl https://gist.github.com/rnelson/9138125/raw/fuckyou.sh | bash`
    Run the following command in your shell:
    ```curl https://gist.github.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```
  5. rnelson revised this gist Feb 21, 2014. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions fuckyou.sh
    100644 → 100755
    Original file line number Diff line number Diff line change
    @@ -25,13 +25,16 @@ cat >~/bin/fuck <<EOF
    if [ -z "\$2" ]; then
    echo "usage: fuck you <program>"
    else
    pkill "\$2"
    echo "(╯°□°)╯ $(echo \$2)"
    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."
    echo "Installation complete."
  6. rnelson revised this gist Feb 21, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    Installation
    ------------
    `curl https://gist.github.com/rnelson/9138125/raw/fuckyou.sh | bash`
  7. rnelson created this gist Feb 21, 2014.
    37 changes: 37 additions & 0 deletions fuckyou.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    #!/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
    pkill "\$2"
    echo "(╯°□°)╯ $(echo \$2)"
    fi
    EOF

    # Make it executable
    chmod +x ~/bin/fuck

    # Done
    echo "Installation complete."