autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCHv2] m4sugar: factor away _AS_ECHO_PREPARE.


From: Paul Eggert
Subject: Re: [PATCHv2] m4sugar: factor away _AS_ECHO_PREPARE.
Date: Mon, 28 Jan 2013 22:00:09 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

Thanks, some minor comments:

> Macros AS_ECHO and AS_ECHO_N now expand unconditionally to
> +   'printf "%s\n"' and 'printf "%s"' unconditionally.

They actually use single-quoted strings, so I'd change your
single quotes to double and vice versa, if you want to keep
the quotes (but see below).

> +Thus, you should use @command{printf '%s\n'}
> +instead of @command{echo}, and similarly use @command{printf %s} instead

The actual code uses "printf '%s'".  It's OK to omit the single
quotes around '%s' but if so it should be done that way consistently
in both documentation and code.

> +Where portability to obsolete environments, prior to the common
> +availability of @command{printf}, is still a concern, and where you
> +cannot be certain the arguments to @command{echo} do not contain
> +backslashes or begin with a minus, it is suggested to use a
> +here-document like this:

I'd reword this to something that's shorter and more off-putting, e.g.,
"Older scripts, written before @command{printf} was portable,
sometimes used a here-document as a safer alternative to @command{echo},
like this:".



reply via email to

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