Live data from Hacker News

The Fuck – Correct your previous console command

github.com

131–140 of 173 posts

Re: The Fuck – Correct your previous console command

#131
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

You know... I've seen this notation on discussion forums (and probably IRC etc.) for years, and had no idea until now that it was a reference to this shell capability lol

Re: The Fuck – Correct your previous console command

#132

I'm going to go out on a limb here and suggest that you rename it "The Fix." Then you could type "fixit" or just "fix".

Guys, we've spotted the Mormon here... he was this close to pooh-poohing that article about the positive productivity effects of coffee, but a curse word used in an extremely minimalist command-line tool has gone too far!

Re: The Fuck – Correct your previous console command

#133
post #87

Earlier quoted context omitted.

American prudishness. There's nothing immature in swearing in and of itself.

> American prudishness Sounds like you need a review of: https://news.ycombinator.com/newsguidelines.html Or perhaps just some common decency ? If you want a tool / platform to take off, using the word 'fuck' is not the way to go.

I too read those guidelines in their entirety and there is nothing there at all about the poignant use of so-called "swear words."

Also:

http://thefuckingweather.com/

http://www.whatthefuckshouldimakefordinner.com/

etc.

Re: The Fuck – Correct your previous console command

#134
post #120

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 !!

Let us not forget, also substitution regexs in bash... $ ls -l /tmp/foo ls: cannot access /tmp/foo: No such file or directory $ !:s/foo/bar -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar

And the shorthand:

    $ ls -l /tmp/foo
    ls: cannot access /tmp/foo: No such file or directory
    $ ^foo^bar
    -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar

Re: The Fuck – Correct your previous console command

#135

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.

Simply change the alias to something else: alias doh='$(thefuck $(fc -ln -1))'

pragmatic and in the hacker spirit, but I'm guessing that the message is more important to the GP than actually using the software.

Re: The Fuck – Correct your previous console command

#136

Earlier quoted context omitted.

Yes, using the word "fuck" for this just strikes me as a bit immature.

American prudishness. There's nothing immature in swearing in and of itself.

"When I first opened Tropic of Cancer and saw that it was full of unprintable words, my immediate reaction was a refusal to be impressed."

Re: The Fuck – Correct your previous console command

#138
post #93

Earlier quoted context omitted.

> 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".

It's arguably ambiguous as to whether the oath would have been minced, if expanded. I've certainly heard people say "what the frick" or similar.

Re: The Fuck – Correct your previous console command

#140
post #134
post #120

Earlier quoted context omitted.

Let us not forget, also substitution regexs in bash... $ ls -l /tmp/foo ls: cannot access /tmp/foo: No such file or directory $ !:s/foo/bar -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar

And the shorthand: $ ls -l /tmp/foo ls: cannot access /tmp/foo: No such file or directory $ ^foo^bar -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar

And the reason for the other approach - global substitution (otherwise the caret approach is simpler)

    $ ls
    hello_world hi_there_world
    $ mv hello_world hello_everyone
    $ !!:gs/hello/hi_there
    mv hi_there_world hi_there_everyone
    $ ls
    hi_there_world hi_there_everyone
Post reply on HN