title: Using bash process substitution for a sudo command
body: <p>I would like to use bash process substitution for a sudo command.</p>
  
  <p>For example, here's a non-sudo command that works for me:</p>
  
  <pre><code>$ cat &lt;(echo "installed.txt")
  installed.txt
  </code></pre>
  
  <p>And here's a sudo version of the command that does not work:</p>
  
  <pre><code>$ sudo cat &lt;(echo "installed.txt")
  cat: /dev/fd/63: Bad file descriptor
  </code></pre>
  
  <p>Reading the sudo man page, it seems that sudo closes all but the stdin/stdout/stderr file descriptors before running the command as root. This leads me to think that bash is creating the descriptor (and performing the process substitution) before running the sudo command.</p>
  
  <p>I changed root's shell to bash (instead of sh default). I've tested that the command works fine when logged in as root. It only does not work via a sudo command.</p>
  
  <p>What is the appropriate technique to achieve what I'm trying to do here? Eval, quoting, sudo flag, sudoers file mod, other?</p>