In fish
shell, the psub
command performs process substitution, so your example would be:
vimdiff (tail /tmp/cachain.pem | psub) (tail /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem | psub)
By the way, I think editing a file in comparison with a specific Git revision of that file is a particularly useful case of process substitution and vimdiff
. Define (in fish
syntax, but easily adaptable to POSIX shell syntax)
function vimgitdiff
vimdiff $argv[1] (git show $argv[2]:$argv[1] | psub)
end
then call
vimgitdiff path/to/file branch-name
to open Vim
with path/to/file
as currently in the working tree on the left and as on branch-name
on the right.