3 ms·
More accurately, it can be used for any command which expects a file and doesn't do anything too weird in reading it (e.g. doesn't seek to the beginning and rea
by TheDong 8y ago
More accurately, it can be used for any command which expects a file and doesn't do anything too weird in reading it (e.g. doesn't seek to the beginning and read it again)
The '<( ... )' is just giving the path to that command's stdout as a file descriptor.
$ ls <(echo hi)
/proc/self/fd/11
$ vi <(echo hi)
# opens vi with 'hi' as the contents
- therein 8y agoThank you. I was just thinking of looking into how it was implemented.
- lloeki 8y agoIt is called "process substitution", and can work the other way around: http://www.tldp.org/LDP/abs/html/process-sub.html http://www.tldp.org/LDP/abs/html/process-sub.html With fish: https://fishshell.com/docs/current/commands.html#psub https://fishshell.com/docs/current/commands.html#psub But there it only works one way: https://github.com/fish-shell/fish-shell/issues/1786 https://github.com/fish-shell/fish-shell/issues/1786