Live data from Hacker News

Explain shell

explainshell.com

41–50 of 56 posts

Re: Explain shell

#41

Welp, I still don't know what :(){ :|:& };: exactly does, but it sure borked my WSL. Error: 0x80070040 after forking too many processes. I know comment moderation sucks, but it would be great to have some kind of wiki/comment system/human generated notes on popular commands.

Interesting that WSL does not take the entire host to doom.

Re: Explain shell

#43
post #26

Earlier quoted context omitted.

The terminal was not built for that kind of automatic lookup, and I often find that options are only interesting in their contexts, so while it might in many cases be possible to show the docs for one option only I think you would have to write a man pages in a different style to make that really usefull. The best place for you to create a PR is against the original program, it says on Explainshell that everything is…

It's not the terminal's fault, it's because man lacks semantic markup.

There is sematic lookup, but I've never seen anyone use it except here on HN:

https://news.ycombinator.com/item?id=15776153

> $ apropos -s 3 Va=optind -a Va=optarg > https://man.openbsd.org/whatis.1

Re: Explain shell

#45
post #41

Welp, I still don't know what :(){ :|:& };: exactly does, but it sure borked my WSL. Error: 0x80070040 after forking too many processes. I know comment moderation sucks, but it would be great to have some kind of wiki/comment system/human generated notes on popular commands.

Interesting that WSL does not take the entire host to doom.

Oh it did. I have 32 cores, but still managed to have so many threads running that Task Manager itself went Not Reaponding.

Re: Explain shell

#46
post #44

This is convenient but I still stand by the statement I made here: https://news.ycombinator.com/item?id=16085604

>Bash has a huge number of little shortcuts that are difficult to learn. [snip] it is difficult to Google for its meaning

Everything you could ever ask for is in the manual and also in the man page.

RTFM: https://www.gnu.org/software/bash/manual/bash.html

If you need a tutorial or a guide then try this one: http://mywiki.wooledge.org/FullBashGuide

Re: Explain shell

#47

Welp, I still don't know what :(){ :|:& };: exactly does, but it sure borked my WSL. Error: 0x80070040 after forking too many processes. I know comment moderation sucks, but it would be great to have some kind of wiki/comment system/human generated notes on popular commands.

It defines a function : that launches two copies of itself in the background. Then it calls that function.

    bomb() { bomb | bomb & }; bomb

Re: Explain shell

#50
post #31

Explain shell is something that has helped me a lot, but the situation of needing it left me baffled for so long... Why can't I search by command + flag? For example, I know what command A does, but I'm not sure what flag C means. I can search for man A, but why can't I search man A --flag C to get only the relevan portion of the manpage? This has baffled me for years. I'd have guessed that discoverability and docume…

What about: man foo | grep bar Then you only get the line with "bar" in it. (append -C 1 at the end to get 1 line before and 1 after the term you grepped for). And of course you can pimp your terminal experience by using fish ( https://fishshell.com/ ) as it ships with autosuggestions and other really nice features. (Beware that it will not provide 100% POSIX compliance but if that's an issue you can use ZSH or pimp…

> What about: man foo | grep bar

I prefer to search from within the pager to see the option description in context:

    man httpd
    /-n
Then 'n' for the next hit or 'N' for the previous, like vi. This is for 'less' in general, not just man.
Post reply on HN