title: How to execute a script only if it is present, in bash?
body: <p>I wonder if there is a simpler way to execute a script in bash only if this script exists. What I want is equivalent to:</p>
  
  <pre><code>if [ -x $name ]
  then
    $name
  fi
  </code></pre>
  
  <p>or</p>
  
  <pre><code>[ -x $name ] &amp;&amp; $name
  </code></pre>
  
  <p>What I am looking for is something like</p>
  
  <pre><code>exec_if_exist $name
  </code></pre>
  
  <p>which eliminates repetition of the script name.</p>
  
  <p>Is there a way to simplify this in bash?
  I do not want a function or "speculative" execution, which would give the command not found error.</p>
  
  <p>Best</p>