title: Python and Bash: how to automate user input?
body: <p>I downloaded some scripts in both python and bash that prompt the user for command line input.  Since I run these scripts often, I would like to automatically supply the input to the programs.  I prefer not to modify the scripts.  Is there a way to do it without modifying the original code?</p>
  
  <p><strong>[UPDATE]</strong> thanks to EnabrenTane's advice, it seems to work pretty well, until I got to a line that read <code>password = getpass.getpass('password: ')</code>.  It complains the following:</p>
  
  <pre><code>File "/usr/lib/python2.4/getpass.py", line 29, in unix_getpass
  old = termios.tcgetattr(fd)     # a copy to save
  termios.error: (25, 'Inappropriate ioctl for device')
  </code></pre>
  
  <p>Any way to get around that?</p>