title: Check if file exist inside tar file using tar and grep command
body: <p>I have a script that check if a file exist inside a tar file but something's wrong because it always go to the 'else' part of the script. I am pretty sure that it shouldn't be that way.</p>
  
  <p>The date is in "Mon dd" format (Jan 11). </p>
  
  <pre><code>echo "enter date: \c"
  read date
  tarfile=`tar -tvf tarfile.tar | grep some_file | grep "$date"`
  
  if [ -f "$tarfile" ]; then
     echo "yes"
  else
     echo "no"
  fi
  </code></pre>
  
  <p>Thanks.</p>