Live data from Hacker News

Explain Shell

explainshell.com

161–170 of 179 posts

Re: Explain Shell

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

See https://github.com/jeroenjanssens/data-science-toolbox/blob/... for a bash script that interfaces with explainshell.com. I wrote this script a while ago. I just needed to update the request because the API had changed a bit since then. Please note that it depends on the scrape tool in the same repository, which in turn depends on the python packages lxml and cssselect. But once you have that set up, you can expla…

The trouble with that approach is that you have to escape special characters:

$ explain cat filename | sort # won't work

$ explain 'cat filename | sort' # presumably would work

I wonder if the best approach is to make `explain` behave like a prompt. If there was some way it could inherit bash's command history, even better

$ explain

explain> cat filename | sort

Re: Explain Shell

#165

Earlier quoted context omitted.

#!/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)

At least you didn't try to do that in bash! ;) One suggestion though: If there are no command line parameters, then read a line from stdin, so you don't have to play the game of trying to properly escape all of your punctuation in the command line to get it into sys.argv[1:] without any corruption, and can just copy and paste it into stdin. Hmm, that raises the question of what should happen if you pipe an entire she…

I've definitely written a URL escaping routine in bash before :)

Re: Explain Shell

#166
post #76

I totally love this, it's already incredibly helpful! It's super-functional, and frankly it's very, very nice looking. To Mr. Idan Kamara, the creator of this, I have nothing but the highest praise! Now, I hate to get side-tracked, but for much larger commands, like this one: ps x -o "%r %c " | grep "someScript.sh" | awk -F' ' '{print $1}' | xargs -I % /bin/kill -TERM -- -% that has a lot of parts, it can be hard to…

Hi! Happy to see explainshell on HN again, thanks for all the compliments! I agree about large commands being hard to follow. I tried solving this by adding the ability to navigate between commands. Right now clicking the command takes you to a page that displays that command options, but I can change it to the equivalent of navigating to it with the arrows at the top. There might be something better to do UI wise, t…

Maybe add the ability to expand and minimize explanations like the ones used in code editors to minimize blocks of code. Love the tool

Re: Explain Shell

#167
The site doesn't mention the !! command.

The !! command is used to repeat the previously issued command.

Re: Explain Shell

#168
post #146
post #76

Earlier quoted context omitted.

Hi! Happy to see explainshell on HN again, thanks for all the compliments! I agree about large commands being hard to follow. I tried solving this by adding the ability to navigate between commands. Right now clicking the command takes you to a page that displays that command options, but I can change it to the equivalent of navigating to it with the arrows at the top. There might be something better to do UI wise, t…

You made ExplainShell? If so great job. I tried some of my favorites `$ du -sh | sort -nr` and `$ grep -nr` and found the output very smart. I second the idea in here that the command should somehow stay visible on screen as you scroll down, but is had an even crazier idea: what if you translated a command into paragraph form at the top as a summary? I might explain `$ grep -nr` to another person as: "search recursiv…

A friend and I are working on a project that not only does what you just described but also allows to go from any programming language to any spoken language (not just shell to english). We will accomplish much of it with the help of the community who can both add natural language representations of code and also help write programs that will enable more programming languages to be explained. It should be released in the coming weeks...(hopefully)

Re: Explain Shell

#169
post #146

Earlier quoted context omitted.

You made ExplainShell? If so great job. I tried some of my favorites `$ du -sh | sort -nr` and `$ grep -nr` and found the output very smart. I second the idea in here that the command should somehow stay visible on screen as you scroll down, but is had an even crazier idea: what if you translated a command into paragraph form at the top as a summary? I might explain `$ grep -nr` to another person as: "search recursiv…

A friend and I are working on a project that not only does what you just described but also allows to go from any programming language to any spoken language (not just shell to english). We will accomplish much of it with the help of the community who can both add natural language representations of code and also help write programs that will enable more programming languages to be explained. It should be released in…

Oh sweet! How can I stay in the loop? I can't wait to see this in action once you have a release :)

Re: Explain Shell

#170
post #169

Earlier quoted context omitted.

A friend and I are working on a project that not only does what you just described but also allows to go from any programming language to any spoken language (not just shell to english). We will accomplish much of it with the help of the community who can both add natural language representations of code and also help write programs that will enable more programming languages to be explained. It should be released in…

Oh sweet! How can I stay in the loop? I can't wait to see this in action once you have a release :)

Hopefully when we post it on HN it will get similar kind of popularity as this post. Otherwise you can follow me on twitter https://twitter.com/RoryDHughes
Post reply on HN