Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the parentheses are just for grouping of the second command. The "<" means feed the stdout of the second command into the stdin of the first.

So what's happening here is the output of curl (a script) is being fed directly into a bash shell and executed. I think it's basically an awkward way of piping a command in reverse.



I think the parentheses are just for grouping of the second command. The "<" means feed the stdout of the second command into the stdin of the first.

Why are there two "<" then? It seems to be required; when I try something like "bash < (curl -s ...)" it fails with syntax error.


alright, never mind what I said before:

http://tldp.org/LDP/abs/html/process-sub.html

Looks like the equivalent of the "read" example partway down the page. curl is actually being executed in a subshell.


using only the second "<" would result in bash being called with a argument like "/dev/fd/N", which is where the output of the subshell is coming from.

The first "<" redirects the output of this file descriptor into the stdin of bash.

So both are needed, but you could just do it with a pipe :/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: