title: How do I include an environment variable inside an alias for bash?
body: <p>I am pretty new to bash, and I want to include an env for bash aliases.. I want to do something like the following</p>
  
  <pre><code>alias foo="bar $(baz)"
  </code></pre>
  
  <p>So that I could do something like the following</p>
  
  <pre><code>&gt; baz=40
  &gt; foo
  </code></pre>
  
  <p>and foo will expand to the command <code>bar 40</code>. Currently the above does not work because $(baz) is expanded while making the alias. Do I have to wrap this inside a function or something?</p>