[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Embedding newlines in commands
From: |
Igor Pechtchanski |
Subject: |
Re: Embedding newlines in commands |
Date: |
Sat, 22 Jan 2005 19:34:44 -0500 (EST) |
On Sat, 22 Jan 2005, Paul D. Smith wrote:
> %% Igor Pechtchanski writes:
>
> ip> reply from Paul D. Smith later in that thread seems to indicate
> ip> that this bug should be fixed, but any attempt to actually embed a
> ip> newline in my Makefile results in the "*** missing separator.
> ip> Stop." error.
Thanks for a prompt reply.
> ip> Was this ever fixed?
>
> It has not been fixed yet.
Yet? :-D (SCNR)
Frankly, I'm having a hard time imagining the syntax of a possible fix,
unless it'd simply provide a ${NEWLINE} (${NL}) built-in make variable (as
there's no way of getting a newline into a variable by other means, e.g.,
via $(shell))... Even if the fix is not in yet, what would it entail?
> The workaround described here:
>
> http://lists.gnu.org/archive/html/help-make/2002-10/msg00068.html
>
> will work though.
Right. Actually, my case is a bit simpler -- the current GNU sed doesn't
stop reading the filename supplied to the 'r' command until a newline, so
sed -e '/PATTERN/{r FILE; d}'
to replace a line with the PATTERN by the contents of FILE didn't work. A
solution would have been to replace ';' by a newline, hence my query. My
workaround is to use
sed -e '/PATTERN/{r FILE' -e 'd}'
(looks ugly, but works).
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ address@hidden
ZZZzz /,`.-'`' -. ;-;;,_ address@hidden
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT