Accessing function-definition-time, not evaluation-time, value for a variable in bash
<p>I hope that I can do something like this, and the output would be "hello"</p>

<pre><code>#!/bin/bash

foo="hello"

dummy() {
  local local_foo=`echo $foo`
  echo $local_foo
}

foo=''

dummy
</code></pre>

<hr>

<p>This question means that I would like to capture the value of some global values at definition time, usually used via <code>source blablabla.bash</code> and would like that it defines a function that captures current variable's value.</p>