Live data from Hacker News

Explain Shell

explainshell.com

81–90 of 179 posts

Re: Explain Shell

#81
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…

Hi, I love this. I bookmarked it and plan to use this often.

Possible additions:

- Something that users of the service could add commands to and the community could up vote for grading on technical difficulty.

- Also a "shell command of the day" type of mailer service would be amazing :)

Re: Explain Shell

#82
post #8

This is pretty cool but what I found annoying was matching the snippet of code and the description together. Take this for example: http://explainshell.com/explain?cmd=true+%26%26+%7B+echo+suc... The command is: true && { echo success; } || { echo failed; } But the top box description is for echo parameters. The next one is for echo. Why can't it go from top to bottom in order of the command? EG: Start with true, the…

I agree it's a little counter-intuitive. But if it's top to bottom then all the lines would cross each other which would ruin the UI. If there's a way to make it top to bottom while keeping the UI useful, I'd love to hear!

Re: Explain Shell

#83
post #80
post #79

Earlier quoted context omitted.

Thanks, that's really fun to hear. ACK on the command substitution not working, with the current lexer that I have in place fixing this isn't easy and might take a while. But it's definitely up there on my todos. Yeah, long pipelines are somewhat of a problem. You can currently navigate the commands with the buttons at the top, maybe they're not visible enough. But I like the idea of being able to pin a particular li…

I liked one idea submitted: having the command pin to the top of the screen on scroll down. It would be tricky to make happen with the hover effect for the boxes, though.

Yes, I had this suggested on numerous occasions and gave it a go a while ago and it's indeed not trivial.

If a JS wiz would like to hack on this I'll gladly help and accept it.

Re: Explain Shell

#84
post #21
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

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.

Thanks for the incentive, but it's not needed and if I do get around to it, it'll of course be open source.

The main difficulty I had with writing a command line utility is figuring out the UI in a console. Suggestions are welcome of course.

Also, there are two possibilities for a client: the first queries an API on explainshell.com by sending it a command line. This has the advantage of the client being thin, and using the centralized man page database which is probably more accurate. But this means that you're potentially not explaining the exact command you're running locally, which may be confusing.

The second option is to run the man page parser, matcher, etc. locally against the man page on your machine.

Re: Explain Shell

#85
Very nice. It was challenged by my go to command:

   tar cf - . | (cd /dest/dir ; tar xvf -)
Which uses tar to copy a directory tree. It didn't know '.' stood for the current directory, it missed out that 'f -' was the file "standard in" / "standard out"

Re: Explain Shell

#86
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…

Hi, I love this. I bookmarked it and plan to use this often. Possible additions: - Something that users of the service could add commands to and the community could up vote for grading on technical difficulty. - Also a "shell command of the day" type of mailer service would be amazing :)

I can scan the access logs for the top explained commands, and show those on the home page (although that will probably only further increase their popularity ;).

Re: Explain Shell

#87

Very nice. It was challenged by my go to command: tar cf - . | (cd /dest/dir ; tar xvf -) Which uses tar to copy a directory tree. It didn't know '.' stood for the current directory, it missed out that 'f -' was the file "standard in" / "standard out"

Why do you use that instead of cp -R ? I would normally only use your version if I was copying a directory tree over ssh.

Re: Explain Shell

#88
post #82
post #8

This is pretty cool but what I found annoying was matching the snippet of code and the description together. Take this for example: http://explainshell.com/explain?cmd=true+%26%26+%7B+echo+suc... The command is: true && { echo success; } || { echo failed; } But the top box description is for echo parameters. The next one is for echo. Why can't it go from top to bottom in order of the command? EG: Start with true, the…

I agree it's a little counter-intuitive. But if it's top to bottom then all the lines would cross each other which would ruin the UI. If there's a way to make it top to bottom while keeping the UI useful, I'd love to hear!

Maybe I'm missing some point, but I don't think you need the lines if it goes top to bottom. Or, maybe you'd only need one line to show up if you highlighted a snippet/description: To point back to what you're hovering over.

Re: Explain Shell

#89
post #84
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.

Thanks for the incentive, but it's not needed and if I do get around to it, it'll of course be open source. The main difficulty I had with writing a command line utility is figuring out the UI in a console. Suggestions are welcome of course. Also, there are two possibilities for a client: the first queries an API on explainshell.com by sending it a command line. This has the advantage of the client being thin, and us…

One advantage of a local repository is that it is more likely to match the software versions on the local machine.

However, perhaps the best thing would be to allow both local and remote queries :-)

Re: Explain Shell

#90

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 thin…

It's definitely doable to add dedicated parsers for options of awk, sed, et al. But it's a lot of work... I doubt someone will go through the trouble of writing a parser for awk, just for this..

What is possible and quite easy is creating links for things that are explained in other tools, such as linking the regex argument of grep to some site that explains regular expressions, or somehow integrate it into the existing UI.

Post reply on HN