Shell programming: echo a variable
Quite often when I write shell scripts, I need to echo a variable for debugging.
If a is 'toto', I'd like to print:
a=toto
Of course, you can do
CODE:
-
echo a=$a
But since I'm a programmer lazy, I'd like to:
CODE:
-
echo_var a
How might you would write the echo_var function? (my solution in the comments)
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



November 10th, 2006 at 21:51
Here is my function