&gt; How is the program like &#x27;ls&#x27; going to see a variable that is an array when originally it was a string delimited with &#x27;:&#x27;?<p>There are two things here: the command &#x27;ls&#x27; that you type on your shell and the executable named &#x27;ls&#x27; located in &quot;&#x2F;bin&#x2F;ls&quot; (or wherever) which can list directories.
  Most shells, when encounter a command X (say,  &#x27;ls&#x27;) they see their &#x27;context&#x27; to see if &#x27;X&#x27; is defined. If yes, they will execute it. If not, they will assume that the X is an executable and try to execute it. 
That&#x27;s what happening here.<p>Perhaps the following silly script helps?<p><pre><code>   #!&#x2F;bin&#x2F;ls
   ls () {
      echo &quot;MYLS $*&quot;
   }
   
   ls $*
</code></pre>
HTH