5 ms·
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
by robbles 15y ago
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.
- redsymbol 15y agoI 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.
- robbles 15y agoalright, never mind what I said before: http://tldp.org/LDP/abs/html/process-sub.html 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.
- robbles 15y agousing 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 :/