Re:Bash process substitution
by denisw on Sunday February 08, 2015 @02:58PM
(#9018300)
A good use case is to redirect output into a file you only can modify with sudo. Trying to do it like this doesn't work:
as the redirection happens within the shell, thus without root permissions. However, the following does work:
as the writing is done by the elevated tee process.
[ Parent
| on HN ]
That seems like an anti-unixism (operating with multiple EUIDs in a single process group), though I'm not too sure what the equivalent unixism would be—maybe something with a daemon and a spool directory? Or a user-writable FIFO, redirected to the correct file by the elevated user in a separate command?