title: What is the difference between alias and export (and a function!)[BASH]?
body: <p>I'm surprised hasn't been asked before, but…</p>
  
  <p>What is the difference between</p>
  
  <p><em>alias</em>   ⇢ <code>alias EXPORT='alias'</code></p>
  
  <p><em>function</em>   ⇢ <code>function exporter() { echo $EXPORT }</code> </p>
  
  <p>and </p>
  
  <p><em>export</em>    ⇢  <code>export ALIAS='export'</code></p>
  
  <p>and for that matter...</p>
  
  <p><code>alias export=$(function)</code>  (j/k)</p>
  
  <p>in <code>bash</code> (<code>zsh</code>, et al.) </p>
  
  <p>Specifically, I'd be most interested in knowing the lexical/practical difference between</p>
  
  <pre><code>alias this=that
  </code></pre>
  
  <p>and</p>
  
  <pre><code>export that=this
  </code></pre>
  
  <p>I have <em>both forms</em>... <em>all over the place</em> - and would prefer to stop arbitrarily choosing one, over the other. </p>
  
  <p>I'm sure there is a great reference to a "scopes and use-cases for unix shells", somewhere... but thought I'd post the question here, in the name of <em>righteous-canonicalicism</em>.</p>