Rien de spécial
Le blog de Régis

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:


Of course, you can do

echo a=$a

But since I’m a programmer lazy, I’d like to:

echo_var a

How might you would write the echo_var function? (my solution in the comments)