bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed --posix does not catch incomplete arguments


From: Jim Meyering
Subject: Re: sed --posix does not catch incomplete arguments
Date: Mon, 21 Jun 2010 12:02:55 +0200

Eric Blake wrote:
> On 06/18/2010 05:27 AM, Bruno Haible wrote:
>> Hi Eric,
>>
>>> About the only portable alternative that I could think of for a makefile
>>> would be to use multiple echo (or printf) into a temporary file, then
>>> use sed -f file, rather than relying on multiple -e.
>>
>> The makefile can also construct a newline as contents of a shell variable.
>> In Makefile syntax:
>>
>>   stmt=`echo "nl='"; echo "'"`; eval "$$stmt"; : | sed -e "1{$${nl}}"
>
> Clever trick!  I was giving up on `` as a way to generate newline,
> because it consumes newlines, but your use of quoting characters and
> eval solves that.

Good one, indeed.

> Is this trick worth documenting in the portable Makefile section of
> autoconf?

Yes.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]