title: Why can I run a Bash function with the 000 permissions?
body: <p>It is not totally rigth that I can run a Bash function with 000 permissions, but almost. My code is: </p>
  
  <pre><code>#!/bin/bash
  function hello {
  echo Hello! }
  </code></pre>
  
  <p>The hello-file has permissions:</p>
  
  <pre><code>-r--------  1 UnixBasics hello_file
  </code></pre>
  
  <p>Firtsly, I type with the current permissions:</p>
  
  <pre><code>$ . ./hello_file;hello
  </code></pre>
  
  <p>The tweak is to change the 400 permissions to 000 right before running the bash script script:</p>
  
  <pre><code>$ chmod 000 hello_file
  $ . ./hello_file;hello                                             [1]
  -bash: ./hello_file: Permission denied 
  Hello!
  </code></pre>
  
  <p>It gives one error, but it does not stop running the function. I cannot understand. I now unset the hello-function: "unset hello". I receive the errors:</p>
  
  <pre><code>-bash: ./hello_file: Permission denied
  -bash: hello: command not found
  </code></pre>
  
  <p>Why did I not get them at the first time? Has it something to do with cache, buffer or something like it? Why can I run the Bash script with 000 permissions [1]?</p>