Rob,

I'm not sure about other surprises, but why are you doing this in a shell
script, and not Perl?  (If you're like me and don't know Perl, I can
understand a little, but I'm _trying_ to learn.)

Mark Post

-----Original Message-----
From: Rob van der Heij [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: Puzzled by Bash interpolation


I have input files that contain lines with variables like

HOSTNAME=$THISHOST
DOMAIN=$THISDOM

and another one that has the definitions like
THISHOST=linux007
THISDOM=rvdheij.com

and I want to produce the files that are like
HOSTNAME=linux007
DOMAINT=rvdheij.com

So I thought I could simply source the definitions
and then run a little loop like
   . ./mydefs
   while read line ; do
     eval echo "$line" ;
   done
This works, except for comment lines in my original
input that suddenly turn out to be blank lines? Now I
suppose I can treat those differently, but what else
am I going to find as a surprise?

Rob

Reply via email to