News for hackers. Stuff that matters.
Re:Explain Shell by lelandbatey on Monday December 02, 2013 @02:06PM (#6835703)
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 connect the different options to the various explanations[0], since there are so many lines and they frequently have similar colors and you have to keep scrolling up and down the page. Being able to do something like click on a command/option and have the page jump to the corresponding explanation would be very helpful.

[0] - http://explainshell.com/explain?cmd=ps+x+-o++%22%25r+%25c+%2...

Re:Explain Shell by idank on Monday December 02, 2013 @03:24PM (#6836254)
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, though.

Re:Explain Shell by brandall10 on Monday December 02, 2013 @03:36PM (#6836328)
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 by idank on Monday December 02, 2013 @03:52PM (#6836436)
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 by robryk on Tuesday December 03, 2013 @09:13PM (#6844567)
You can also count how often they are requested from the links on the home page. Granted, the additional popularity will probably cause people to share those more often.
Re:Explain Shell by JonnieCache on Monday December 02, 2013 @04:33PM (#6836686)
Weight them by a power of their age or something like that.
Re:Explain Shell by vram22 on Monday December 02, 2013 @04:02PM (#6836493)
> Also a "shell command of the day" type of mailer service would be amazing :)

See:

https://mobile.twitter.com/climagic

http://www.commandlinefu.com/commands/browse

Re:Explain Shell by shawndrost on Monday December 02, 2013 @05:08PM (#6836916)
Put the command in a sticky header.
Re:Explain Shell by err4nt on Tuesday December 03, 2013 @12:11AM (#6838668)
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 recursively within all files and subdirectories in the current folder and display the results with line numbers" or I might describe `$ du -sh | sort -nr` as ”display the disk used by files and folders in the current directory using human-readable file sizes and sort the output from largest to smallest"

Your tool provides all of this information already, I wonder what it would take to get it that final step to put it into laymans terms while still showing the breakdown of the actual command (which is truly the only way to learn to use it).

Congrats on making such a great tool, I can't wait to tell my friends tomorrow :)

Re:Explain Shell by roryhughes on Tuesday December 03, 2013 @02:32PM (#6842544)
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 by err4nt on Tuesday December 03, 2013 @02:50PM (#6842676)
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 by roryhughes on Tuesday December 03, 2013 @02:56PM (#6842719)
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
Re:Explain Shell by nikhilalmeida on Tuesday December 03, 2013 @01:20PM (#6842037)
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 by etrain on Monday December 02, 2013 @02:42PM (#6835982)
Very cool - but support for xargs seems to be broken.

    find . -type f | xargs wc -l
http://explainshell.com/explain?cmd=find+.+-type+f+%7C+xargs...
Re:Explain Shell by un1xl0ser on Monday December 02, 2013 @07:13PM (#6837598)
I would expect xargs to stop processing arguments strictly after the first non-flag argument.

Arguments to xargs do appear to be parsed, example below:

http://explainshell.com/explain?cmd=find+%2F+-type+f+-print0...

Re:Explain Shell by etrain on Thursday December 05, 2013 @05:57PM (#6858018)
Right, but in this example it's not telling me what the "grep" is doing. Admittedly xargs is a weird case where the arguments to the program are invoked as a program, but I'd say it shows pretty frequently in these type of "what does this long freaking command do?" situations. Maybe worth adding a special case for.
Re:Explain Shell by RussianCow on Monday December 02, 2013 @02:57PM (#6836080)
Or you could have the command itself be statically positioned and only have the explanations scroll.
Re:Explain Shell by riquito on Monday December 02, 2013 @05:47PM (#6837170)
Or you may shorten your command

  ps -C someScript.sh -o pid= | xargs -I % /bin/kill -TERM -- -%
avoiding two pipes is also 1 femtosecond faster, and as an added bonus HN doesn't trigger the dreaded code scrollbars too!
Re:Explain Shell by d0m on Monday December 02, 2013 @06:21PM (#6837337)
This is the two best arguments I have ever seen comparing two piece of code! You totally convinced me.
Re:Explain Shell by marbu on Tuesday December 03, 2013 @07:40AM (#6839886)
You can shorten it even further with pkill or killall:

pkill ^someScript.sh$ --signal TERM

Either way pgrep is a nice command to learn about.

Re:Explain Shell by greytwo on Monday December 02, 2013 @03:10PM (#6836174)
Is this paralipsis(http://prevaricate.me/?p=451) or meta-paralipsis?
Re:Explain Shell by lelandbatey on Monday December 02, 2013 @03:26PM (#6836263)
I don't know if I'd term it paralipsis, but I do get what you're saying about the weird contrast between praise followed by criticism. It does seem off, or maybe two faced, when interpreted at face value.

The thing is, I do mean both of the sentiments I shared. I do think it's a fabulous and original idea. I also felt that in one particular use case, it's presentation was a little confusing. Because I'm not the best writer/speaker, it probably came across more insensitively than I was hoping for though.