Live data from Hacker News

Explain Shell

explainshell.com

31–40 of 179 posts

Re: Explain Shell

#31
So I fed it : cat ./trunk/.config |awk ' /CONFIG_TARGET_BOARD/ { gsub(/\"/,""); split($0,a,"="); print a[2] }'

A little one-liner I worked up a few days ago to quickly show me which architecture my OpenWRT trunk was last built with. I'd really like it to explain in much more detail what each of the terms inside the awk command do. Perhaps make "explain" modular so that people can add more detail to the gazillion things that can happen inside awks, seds, greps, etc?

Fabulous idea. This should have been in unix all along as part of the man system.

Re: Explain Shell

#32
post #4

Very well done. Now I just wish this was a shell program! user@server:~$ explain iptables -A INPUT -i eth0 -s ip-to-block -j DROP

    #!/usr/bin/env python
    
    import sys
    import urllib
    import webbrowser
    
    url = "http://explainshell.com/explain?cmd=" + urllib.quote(' '.join(sys.argv[1:]))
    webbrowser.open_new(url)
(webrowser.open_new doesn't seem to be always working for me, not sure why, I've never used it before)

Re: Explain Shell

#36
post #21

Earlier quoted context omitted.

I'll donate $100 if the author wants to build this and open source it. [Ed: As a shell application locally] A new "explain" command could help me, my team, and save us an enormous amount of time getting up to speed on some of our org's long-term system maintenance scripts.

How about an API where you can POST your script with curl -X and a unique link is returned that explains the script when you hit it with a browser? #shutupandtakemymoney (DevOps is fun, teaching not always)

[deleted]

Re: Explain Shell

#40
post #11

I don't know what I was expecting, but one of my most-used command lines, "du -a | grep foo" is pretty uninformative.

I'm curious why this is one of your most-used commands. If you want to know the sizes of all files matching 'foo', this is a horribly inefficient way of going about it.
Post reply on HN