From: ron_barrett () corp ! cubic ! com
To: tru64-unix-managers
Subject: BASH env. variable's
Date: Tue, 16 Apr 1996 11:31:18 +0000 [thread overview]
Message-ID: <96076331021323.tru64-unix-managers.marc@archive.invalid> (raw)
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@corp.cubic.com
Date: 04/16/96
-------------------------------------
reply other threads:[~1996-04-16 11:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox