/dev/fd/11 is a named pipe, whereas /tmp/zshbEF1D9 is a plain file. There are situations where named pipes fail, where you actually do need a plain file, and I can't think of a single one offhand. :)
"I've run into it in the past" is all I can say. And the above snippet at least gives one specific example of a hypothetical case.
> There are situations where named pipes fail, where you actually do need a plain file
In general: If the command you are passing the named pipe to expects a file which it can randomly access, a named pipe won’t work.
I ran into this today using a python tool, yamldiff. I was trying to diff a local yaml file with one from a cluster obtained via kubectl, eg:
yamldiff localManifest.yaml <(kubectl get … —output yaml)
and it failed with python telling me the file wasn’t seekable. Then I remembered this thread which I had initially read a few days ago and tried =() (since I use shell) — and it worked!
vs
The first will complete instantly and result in a file named foobar but whose contents is either zero length or foo, depending on how unlucky you are.The second takes one second to complete and results in a file named foobar containing foobar.
It’s strange that vanilla process substitution can’t seem to solve this at all.