title: Bash script not found although it is in the $PATH
body: <p>On LMDE-based laptop I have a script <code>upgrade.sh</code> which only runs the following commands:</p>
  
  <pre><code>#!/bin/sh
  
  apt-get upgrade
  apt-get dist-upgrade
  </code></pre>
  
  <p>The script is in the <code>/home/francois/scripts</code> directory. I can easily run it from within this directory. It just works. Now I run the following commands:</p>
  
  <pre><code>$ sudo ln -s /home/francois/scripts /opt/scripts
  $ sudo ln -s /opt/scripts /usr/local/bin/scripts
  </code></pre>
  
  <p>and create file <code>/etc/profile.d/myscripts.sh</code></p>
  
  <p>with just one line:</p>
  
  <pre><code>export PATH=$PATH:/usr/local/bin/scripts
  </code></pre>
  
  <p>I type </p>
  
  <pre><code>$ echo $PATH
  </code></pre>
  
  <p>and see that it contains <code>/usr/local/bin/scripts</code></p>
  
  <p>But when I run </p>
  
  <pre><code>$ sudo upgrade.sh
  </code></pre>
  
  <p>from any directory the system says that <code>the command not found</code></p>
  
  <p><code>ls -l</code> shows <code>-rwxr-xr-x 1 francois francois</code> ...</p>