title: How to supply sudo with password from script?
body: <p><strong>Please note:</strong> this is a guest VM (VBox) running on my local machine, and I'm not worried about security.</p>
  
  <p>I am writing a script that will be executed on a Linux (Ubuntu) VM as the <code>myuser</code> user. This script will create a very large directory tree under <code>/etc/myapp</code>. Currently I have to do all this manually, and it starts with me giving <code>myuser</code> recrusive <em>rwx</em> permissions under <code>/etc</code> like so:</p>
  
  <pre><code>sudo chmod -R 777 /etc
  [sudo] password for myuser:  &lt;now I enter the password and hit ENTER&gt;
  </code></pre>
  
  <p>My question: how do I write a bash script that supplies the <code>sudo</code> command with my password so that I can just execute <code>bash myscript.sh</code> and it will make the necessary permission changes for me?</p>