title: grep command in shell is taking too long
body: <p>Below is the part of my shell program where the grep command is taking too long to produce result ,</p>
  
  <pre><code>logdir="/logs/orderjob"
  recentorderjobFile=$(ls -t $logdir/orderjob* | head -n1)
  start=`grep 'TWS has called script' $recentorderjobFile`
  </code></pre>
  
  <p>But i am not seeing any slowness when manually run the grep command for the log file.</p>
  
  <pre><code>grep 'TWS has called script' orderjob_12042018.log
  </code></pre>
  
  <p>Why the grep command in start variable is taking long time/not producing the results?.How can i modify the command to get the expected results quickly?.</p>