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

Bug#490605: debian-policy: please discourage the usage of echo -n, and echo in general



Hi,

On 8 July 2012 19:22, Jonathan Nieder <jrnieder@gmail.com> wrote:
> In July, 2008, Raphael Geissert wrote:
>> As demonstrated by the following trivia[1], and also mentioned by SUSv3, the
>> echo built-in varies from implementation to implementation and thus should be
>> discouraged.
[...]
>> Shells tested: 8
>> Shells expandind backslashes: 5
>> /bin/echo does NOT expand
[...]
> I think it would make sense to discourage use of strings that might
> contain a backslash as arguments to "echo" in some informative
> document such as devref or in a footnote to policy.

And the use of strings that might begin with a dash character (minus
sign, actually), as demonstrated by the incompatible behaviour with
strings such as "-e", "-E", "--", "--version", "--help".

> The discussion of this bug seems to have clarified that use of
> echo and "echo -n" to print static strings is popular and not
> something that is going away soon.

I would prefer to back those statements up with real figures, but
let's assume for a moment that the opinion of those who have commented
on the report reflect reality.

> Does that seem like a fair summary?  What do you suggest as a next
> step?

I think that proposing a wording based on the above is the next step forward.

Policy editors: do you have any suggestion as to where such
informative notes should be added? perhaps as another footnote to
section 10.4, referenced by "echo -n" exception?

Additionally, I think that the "echo -n" exception should better be
phrased in the following way:

'echo', if implemented as a shell built-in, must not generate a
newline when the first operand is '-n'.

Rationale: consistency with the other exceptions, where the name of
the utilities are first mentioned without any arguments.

Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net


Reply to: