BASH env. variable's

From: <ron_barrett_at_corp.cubic.com>
Date: Tue, 16 Apr 96 11:31:18 PDT

Hello,
        I'm having trouble de-referencing environment variables in bash
(v1.14.6(4)) running under DU v3.2c. If I use echo statements with hard
coded variables (ie echo "variable 1 is ${var1}."), this works as I would
expect with variable var1 being translated into it's contents. If I try to
deference that variable with one more degree of indirection, however, it
appears to fail to de-reference. Hence if I have file called prog.msg with
the 1 line of text which reads:

variable 1 is ${var1}.

and I use the command echo "$(cat prog.msg)", my expectation is that the
var1 reference in the prog.msg file would get de-referenced and that the
resulting output from my command would be "variable 1 is _var1_contents_.",
but instead I get the output "variable 1 is ${var1}." There's a nice
section in the man pages on using quoting to prevent variables from being
de-referenced, but nothing which I can see on forcing variables to be
recognized and de-referenced. Am I missing something obvious here?

TIA,
Ron
-------------------------------------
Name: Ron Barrett
E-mail: ron_barrett_at_corp.cubic.com
Date: 04/16/96
-------------------------------------
Received on Tue Apr 16 1996 - 21:19:46 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT