> I have input files that contain lines with variables like
>
> HOSTNAME=$THISHOST

In my environment HOSTNAME is already set by bash. You should use another name.


> 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

I'm not surprised at that. The # introduces a comment, and the comment is being
dropped in the eval

> suppose I can treat those differently, but what else
> am I going to find as a surprise?


Depends on what else you do.

I suspect you should be using m4. That's a whole new adventure;-)


--
Cheers
John Summerfield

Microsoft's most solid OS: http://www.geocities.com/rcwoolley/

Note: mail delivered to me is deemed to be intended for me, for my disposition.

==============================
If you don't like being told you're wrong,
        be right!

Reply via email to