title: How to avoid a bash script from failing when -e option is set?
body: <p>I have a bash script with <code>-e</code> option set, which fails the whole script on the very first error.</p>
  
  <p>In the script, I am trying to do an <code>ls</code> on a directory. But that path may or may not exist. If the path does not exist, the <code>ls</code> command fails, since the <code>-e</code> flag is set. </p>
  
  <p>Is there a way by which I can prevent the script from failing?</p>
  
  <p>As a side note, I have tried the trick to do an <code>set +e</code> and <code>set -e</code> before and after that command and it works. But I am looking for some better solution.</p>