Thefuck: running "fuck" twice almost gave me a heartattack

Created on 17 Apr 2015  路  17Comments  路  Source: nvbn/thefuck

who@where:~$ fuck
No fuck given
who@where:~$ fuck
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
/dev/sda6 is mounted.

WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.

Do you really want to continue<n>? no
check aborted.

Most helpful comment

@brianshumate Wouldn't a third fuck fix that though?

All 17 comments

This doesn't happen for me on OSX 10.10, that's interesting.

It's a bit strange, do you wrote something in another terminal between two fucks?

Haha this made my day. However, I could not replicate this on Linux Mint 17 (Ubuntu 14.04).

The fsck would not succeed as a non-root user anyway.

Can reproduce this on ubuntu 14.10. For me I just need to execute this twice:

> /usr/lib/command-not-found fuck
No command 'fuck' found, did you mean:
 Command 'suck' from package 'suck' (universe)
 Command 'fsck' from package 'util-linux' (main)
fuck: command not found

The order of suck and fsck is changed on each call. When fsck is shown first, the error appears.

When I remove the subshell from the shell alias this is easily visible:

> fuck
No fuck given
> fuck
fsck
> fuck
suck

At first, I tested the apt-get, as shown in the README, and then tried running fuck again, and that was the first time the error happened.

Then I closed the console, and opened another again; and that's the output you're seeing.

btw, I'm running Linux where 3.13.0-49-generic #81-Ubuntu SMP Tue Mar 24 19:29:48 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

btw. I just added an additional alias for testing. It simply outputs the command fuck would execute:

alias tryfuck='thefuck $(fc -ln -1)'

@brianshumate Wouldn't a third fuck fix that though?

I added check if previous command is fuck. It should fix this issue.

@mvirkkunen given enough fucks, i think this could totally fuck one's system up, yes.

Confirmed. Fixed for me.

However, I would prefer to make the rule "thefuck/rules/no_command.py" ask before executing the command suggested by /usr/lib/command-not-found. Would make it a lot less dangerous.

fuck needs audio speech recognition. This way if it fucks things up and you end up screaming 'fuck!' out loud it will know not to do that again... or not. Fuck it if I know.

I got to admit, you created a damn good title for this issue..

@zmarouf Deffenitly a +1 on that!

alias nostop="sudo halt"

@LaMi- you need to try require_confirmation settings option, it's doing almost what you want.

I think @LaMi- pointed the most important issue: proposing once suck before fsck and the other time fsck before suck is not acceptable, since order matters: suck is far better before fsck

Summing up everything, now confirmation required by default and when previous command is fuck (or another alias) will be used a command before it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shelbyKiraM picture shelbyKiraM  路  5Comments

griffinqiu picture griffinqiu  路  4Comments

pizzathief picture pizzathief  路  6Comments

disjunto picture disjunto  路  6Comments

steve02081504 picture steve02081504  路  5Comments