title: How do I edit /etc/sudoers from a script?
body: <p>I need to edit <code>/etc/sudoers</code> from a script to add/remove stuff from white lists.</p>
  
  <p>Assuming I have a command that would work on a normal file, how could I apply it to <code>/etc/sudoers</code>?</p>
  
  <p>Can I copy and modify it, then have <code>visudo</code> replace the original with the modified copy? By providing my own script in <code>$EDITOR</code>?</p>
  
  <p>Or can I just use the same locks and <code>cp</code>?</p>
  
  <p>The question is more about potential issues than about just finding something that works.</p>