I am trying to compare two command output (no files)
vimdiff "$(tail /tmp/cachain.pem)" "$(tail /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem)"
I tried playing with redirection, pipe, and vim - -c
but I must be missing something. Can anyone help please ?
Best Answer
You are confusing
$(…)
with<(…)
. You used the former, which passes the output as arguments tovimdiff
. For example, if the last line of/path/to/foo
containsbar bar bar
, then the following commandis equivalent to
Instead, you need to use
<(…)
. This is called process substitution, and passes the output as a pseudo-file to thevimdiff
command. Hence, use the following.This works in
bash
andzsh
, but apparently there is no way to do process substitution intcsh
.