title: Why does these sudo commands fail?
body: <p>I would like to add a crontab entry from a script as a normal user, so I use <code>sudo</code> to get <code>root</code> permissions, but fails no matter what I try.</p>
  
  <pre><code>$ sudo { crontab -u root -l; echo ' 15  9  *  *  * root /opt/script.sh'; } | crontab -u root
  bash: syntax error near unexpected token `}'
  
  $ sudo echo ' 15  9  *  *  * root /opt/script.sh' &gt;&gt; /etc/crontab
  bash: /etc/crontab: Permission denied
  $ sudo echo ok
  ok
  </code></pre>