Live data from Hacker News

The Fuck – Correct your previous console command

github.com

91–100 of 173 posts

Re: The Fuck – Correct your previous console command

#91
post #71

Cool idea. For those systems where you don't have the option of adding a 3rd party tool, it's probably worth knowing some of the standard bash shortcuts. The easy to remember ones are: !^ - the first argument from the previous command !$ - the last argument from the previous command !* - all of the arguments from the previous command !! - the entire previous command For example: $ apt-get install foo # Crap $ sudo !!

Typo correction is useful too. ^foo^bar git brnch ^r^ra This works on all Unix machines

*Works if properly implemented. Had to manually disable this behavior in eshell as it prevented you from running regex with two carets, e.g. '$ grep -E '^sometext[^ ]+moretext'.

You can also just run a sed style substitution in most shells, e.g. '$ !!:s/before/after/' or '$ !!:gs/x/y/', which is safer IMO.

Re: The Fuck – Correct your previous console command

#92

An issue that popped up for a user, kind of funny: https://github.com/nvbn/thefuck/issues/1 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 ? no check aborted.

Yeah, OP here. It really almost gave me a heart attack ;)

Re: The Fuck – Correct your previous console command

#93
post #60

Earlier quoted context omitted.

WTF means the same thing. That is no less vulgar.

> WTF means the same thing. That is no less vulgar. Vulgarity of expressions is not a function only of what the expression means, but of the acceptability of the expression itself in various social contexts. WTF is, generally, acceptable as not excessively vulgar in social contexts where expanding the last letter of the initialism into its referent would not be, but the reverse isn't true; WTF is pretty close, theref…

> "WTF is, generally, acceptable as not excessively vulgar in social contexts"

Which social contexts? Social contexts where people don't know what "WTF" expands to? It's not even a "minced oath".

Re: The Fuck – Correct your previous console command

#94

Cool idea. For those systems where you don't have the option of adding a 3rd party tool, it's probably worth knowing some of the standard bash shortcuts. The easy to remember ones are: !^ - the first argument from the previous command !$ - the last argument from the previous command !* - all of the arguments from the previous command !! - the entire previous command For example: $ apt-get install foo # Crap $ sudo !!

I've been using "sudo !!" (which I pronounce as sudo bangbang in my head) for a while now, mostly with vim for editing stuff in /etc. It's very nifty.

Another nifty tool is vi editing mode. You run "set -o vi", and now your shell takes vi modal editing commands. That along with Ctrl-r for reverse history search has made life in the shell so much easier. Bash has a ton of little stuff like that built in. Zsh has a few more.

Re: The Fuck – Correct your previous console command

#96

I think it's a funny little app. I could see it being kind of useful for the author but I think I would personally have trouble using an app that I don't actually know what it's going to do 100%. I think that you could mitigate this a bit by putting the list of commands it corrects right at the top of the readme. I think most of us have probably been at the point where we were typing something like "I hate you, you g…

Check out the only issue open: https://github.com/nvbn/thefuck/issues/1 I like it, but I have to know every command it modifies/checks, I cannot run a blackbox command and hope.

That issue has an alias you can use:

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

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

Re: The Fuck – Correct your previous console command

#97
I've started to wonder why we've never seen a more IDE-like autocomplete in consoles. I mean, why do I have to use man pages and all sorts of reference guides to remember the parameters for find or grep or whatever, or the order of commands for whatever?

There really needs to be better communication between software and the environment it's running in.

Re: The Fuck – Correct your previous console command

#100

I will not let my coworkers see me typing expletives into terminal; much less if it is a woman. It is a nice idea, though. Will use it if it's called auto-correct or something.

I'm not sure what difference you think gender makes, unless you think women are delicate flowers that must be sheltered from bad language, but I do agree that it would be better named something more office friendly. I'd suggest 'argh', 'grr' or 'gah'.
Post reply on HN