[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: combining $(eval) with $(shell)
From: |
Stephan Beal |
Subject: |
Re: combining $(eval) with $(shell) |
Date: |
Tue, 10 Sep 2013 16:36:38 +0200 |
On Tue, Sep 10, 2013 at 2:13 PM, Paul Smith <address@hidden> wrote:
> On Mon, 2013-09-09 at 17:45 -0700, Adam Kellas wrote:
> > I'm having a problem using these two together. There's a program which
> > spits out a series of variable assignments so I need $(shell) to
> > invoke it, but the shell function strips newlines which garbles the
> > result. Example below. Ideas?
> >
> > % cat Makefile
> > $(eval $(shell ./vars.sh))
>
> There's no way to avoid this feature of the shell function. The best I
> can suggest is that you write the output to a temporary file, then
> include that; something like:
>
Another workaround is to have vars.sh add a semicolon to the end of each
line:
cat <<EOF
a=foo;
b=bar;
EOF
so it's still valid after newlines are stripped.
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal