It's really important because intuitively they are all similar for me.
Could one realise that those two are really like one another for me, i.e. absolutely equal?
They don't do the same thing at all. The former is command substitution, the latter is piping. The result is completely different.
grep foo "$(echo foo)"
will look for the word "foo" in a file called "foo", because "foo" is the output from echo
. echo foo | grep foo
will look for the word "foo" from its STDIN
input. In the former case, you'll probably get a file not found error. In the latter case, you won't. They're fundamentally not the same operation.
equery -q files '*'
bash: /usr/bin/equery: Argument list too long equery -q uses xargs equery -q files '*'
grep SMTH <(CMD)
instead ofgrep SMTH $(CMD)
? cause first one is really close toCMD | grep SMTH
.xi@localhost ~ $ grep SRC_URI $(find /usr/portage -name *.ebuild) | wc -l 25921 xi@localhost ~ $ cat $(find /usr/portage -name *.ebuild) | grep SRC_URI | wc -l 25921
- no difference, except for inclusion of filename with directgrep