-o >(grep O_DIRECT)
This is cool. Never seen it (but it makes sense.) diff <(cmd a) <(cmd b)
is also very handy.<()
See? Penguin!
$ echo <(echo 1) <(echo 2)
/dev/fd/63 /dev/fd/62
The shell spawns two commands connected to pipes, then replaces those with a file that represents the other (read) side of that pipe.The command above with >(grep something) does the same thing, just with the other end of a pipe.
More: https://www.gnu.org/software/bash/manual/html_node/Process-S...
$ ls <(echo A)
/dev/fd/63
$ cat <(echo A)
A
So diff <(command1) <(command2)
becomes diff /dev/fd/62 /dev/fd/63 $ echo <(echo hi)
/dev/fd/63
If a program reads from that file path, it gets the output of the command chain. $ cat <( (echo foo; echo bar) | grep bar )
bar
Of course, that's a silly example. But that explains how the diff example works, since it's the same idea: diff just reads from the two "files".EDIT: Heh, 5 different replies within the same 60 second window.
you might want to read into redirection on the commandline, it's amazingly powerful