title: How do I pass in arguments non-interactive into a bash file that uses "read"?
body: <p>I have the following shell script:</p>
  <pre class="lang-sh prettyprint-override"><code>#! /bin/bash
  
  . shell_functions/commonShellFunctions.sh
  . shell_functions/settings.sh
  _valid_url=1
  
  echo &quot;Welcome to HATS Accessibility Testing Tool!&quot;
  echo &quot;We recommend using Chrome browser for the best experience.&quot;
  echo &quot;What would you like to scan today?&quot;
  
  options=(&quot;sitemap file containing links&quot; &quot;website&quot;)
  
  select opt in &quot;${options[@]}&quot;
  do
      case $opt in
  
          &quot;sitemap file containing links&quot;)
  
              scanType=&quot;sitemap&quot;
              crawler=crawlSitemap
              prompt_message=&quot;Please enter URL to sitemap: &quot;
              break;;
  
          &quot;website&quot;)
  
              prompt_website
              break;;
  
          &quot;exit&quot;)
              exit;;
  
          *)
              echo &quot;Invalid option $REPLY&quot;;;
  
      esac
  
  done
  
  read -p &quot;$prompt_message&quot; page
  
  
  echo $page
  </code></pre>
  <p>It was meant to prompt the user, however I wish to use the script in a CI setting where I pass the arguments through the console without prompting.</p>
  <p>I'm currently using <code>echo &quot;&lt;ARG1&gt;\n&lt;ARG2&gt;&quot; | bash run.sh</code>, but I'm wondering if there's a better way to do this.</p>