title: su pass password to script
body: <p>I am trying to write a script that will run the following commands:</p>
  
  <pre><code>sudo su
  runmqsc_result=`su -c "runmqsc QMGR &lt; /home/rob/query_queue.txt" -m "mqm"`
  </code></pre>
  
  <p>My issue however, is that these commands are run as part of a shell script, by user that is in the sudoers file. However, obviously sudo su asks for the password of the user running it.</p>
  
  <p>What I need to do is to pass the password to sudo su so that the script will run automatically. How can I do this?</p>
  
  <p>p.s: I can't change the permissions for running "runmqsc"...it HAS to be run as user mqm which needs to be switched to from the root user.</p>