title: bash let variable default to user input
body: <p>I want to write a script for both interactive and batch use. If arguments are not provided the script will ask for the users input.</p>
  
  <p>Unlike <a href="https://stackoverflow.com/questions/2642585/read-a-variable-in-bash-with-a-default-value">here</a> the user shouldn't be bothered if the variable is already defined by arguments.</p>
  
  <p>Using parameter expansion I tried this:</p>
  
  <pre><code>${FILE="$( echo "Please provide the file:" &gt;&amp;2 ; read a; echo $a )"}
  </code></pre>
  
  <p>... but I always get a <code>command not found</code> error.</p>
  
  <p>Any suggestions?</p>