title: Running command within test statement in bash
body: <p>I have a piece of code to find the first file in a directory:</p>
  
  <pre><code>bash~&gt; $( echo eval "ls | head -1" )
  arguprog.sh
  </code></pre>
  
  <p>This snippet was then added to an if statement, to run a different set of commands if that file was arguprog.sh:</p>
  
  <pre><code>bash~&gt;  if [[ $( echo eval "ls | head -1" ) == "arguprog.sh" ]]; then echo "TRUE"; else echo "FALSE"; fi;
  FALSE
  </code></pre>
  
  <p>However this is not doing what I want. It returns FALSE even though the first file is arguprog.sh!</p>
  
  <p>Is there a way to resolve this while still doing the string comparison entirely within the test block?</p>