Re: sed --posix does not catch incomplete arguments

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

 



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.

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

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux