Live data from Hacker News

Explain Shell

explainshell.com

121–130 of 179 posts

Re: Explain Shell

#121
post #119
post #104

Earlier quoted context omitted.

The kernel could start 100 processes in the time it takes me to type those extra four characters. We won't run out of processes. I did a test, finding .txt files in /usr/share, it took about .25 seconds longer with du and grep, which seems like less than it takes to type 4 more characters.

How long does it take you to type a character???

Assume I type 80 wpm

A word is standardized as 5 keystrokes

80 wpm is therefore 400 keystrokes per minute.

Divide by 60 to get about 6.6 keystrokes per second, or about 0.15 seconds per keystroke.

Therefore it would take about 0.6 seconds to type the four extra characters, giving a net savings to use du+grep instead.

And 80 wpm is probably a rather fast estimate; I'd guess that I type slower when I'm writing commands than when I'm entering English text.

Re: Explain Shell

#122

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…

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

#123
post #116

It's a nice toy, but seems to break down with more interesting stuff. For instance: for FILE in `ls`; do echo $FILE ; done http://explainshell.com/explain?cmd=+for+FILE+in+%60ls%60%3B... That's a simpler equivalent of something I cooked up which probably didn't belong in a single line of shell anyhow.

You've hit the two top things on my to do list.. command substitution and control flows. It says on the top of the home page that they're not implemented yet.

That's what I get for trying to play with a new site after Thanks Giving weekend! You already have a solid tool, that will make it even better ;)

Re: Explain Shell

#127
post #99

It unfortunately can't decode :(){ :|:& };:, a classic unintelligible forkbomb. I suppose it's only lack of function support that's the issue! Really neat program, nonetheless!

I'm tempted to add a place holder for all the variations of this forkbomb, until I teach the parser about functions. You'll be amazed how many people try this (or other 'malicious' commands), presumably thinking I'm executing the queries. ;)

I tried this, but not because I believed that you would execute it, but because a very important use of such a tool would be to explain potentially dangerous commands and their implications.

Re: Explain Shell

#128

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…

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!

This is the two best arguments I have ever seen comparing two piece of code! You totally convinced me.

Re: Explain Shell

#130
post #121
post #119

Earlier quoted context omitted.

How long does it take you to type a character???

Assume I type 80 wpm A word is standardized as 5 keystrokes 80 wpm is therefore 400 keystrokes per minute. Divide by 60 to get about 6.6 keystrokes per second, or about 0.15 seconds per keystroke. Therefore it would take about 0.6 seconds to type the four extra characters, giving a net savings to use du+grep instead. And 80 wpm is probably a rather fast estimate; I'd guess that I type slower when I'm writing commands…

I will switch immediately! ;-)
Post reply on HN