I have this situation:
zmx_stderr='\033[1;35m'
zmx_stdout='\033[1;36m'
tag='foobar'
tailing(){
echo "tailing logs for ${tag} ...";
while read line; do
echo -e "$zmx_${1} $tag $1${zmx_no_color}: $line"
done;
}
someone calls tailing() with:
tailing stderr
tailing stdout
how can I look up the zmx_stdout and zmx_stderr dynamically?
This doesn't work:
$zmx_${1}
I just get this:
stdout foobar stdout:
but I am looking for:
foobar stdout:
with control chars being generated.