GNU bug report logs -
#51311
[PATCH] echo: update --help to document edge cases
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#51311: [PATCH] echo: update --help to document edge cases
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 51311 <at> debbugs.gnu.org.
--
51311: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=51311
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
On 20/10/2021 22:50, Florent Flament wrote:
>
> * src/echo.c (usage): Document edge cases when displaying arbitrary
> strings with the echo command.
> ---
> src/echo.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/echo.c b/src/echo.c
> index 18513398a..73b44660b 100644
> --- a/src/echo.c
> +++ b/src/echo.c
> @@ -78,6 +78,14 @@ If -e is in effect, the following sequences are recognized:\n\
> fputs (_("\
> \\0NNN byte with octal value NNN (1 to 3 digits)\n\
> \\xHH byte with hexadecimal value HH (1 to 2 digits)\n\
> +"), stdout);
> + fputs (_("\
> +\n\
> +NOTE: The echo command doesn't behave gracefully when displaying\n\
> +arbitrary strings. For example, it can't display the string \"-n\" and\n\
> +requires the STRICTLY_POSIX flag to display \"-e\" or \"-E\". Therefore,\n\
> +if you need to display arbitrary strings please use the printf command\n\
> +instead.\n\
> "), stdout);
> printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
> emit_ancillary_info (PROGRAM_NAME);
This is too verbose.
BTW the env var is POSIXLY_CORRECT, not STRICTLY_POSIX.
Anyway I don't think we should mention that in the man page anyway.
I'll push the attached later, which just says printf(1) is preferred.
cheers,
Pádraig
[echo-printf.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
* src/echo.c (usage): Document edge cases when displaying arbitrary
strings with the echo command.
---
src/echo.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/echo.c b/src/echo.c
index 18513398a..73b44660b 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -78,6 +78,14 @@ If -e is in effect, the following sequences are recognized:\n\
fputs (_("\
\\0NNN byte with octal value NNN (1 to 3 digits)\n\
\\xHH byte with hexadecimal value HH (1 to 2 digits)\n\
+"), stdout);
+ fputs (_("\
+\n\
+NOTE: The echo command doesn't behave gracefully when displaying\n\
+arbitrary strings. For example, it can't display the string \"-n\" and\n\
+requires the STRICTLY_POSIX flag to display \"-e\" or \"-E\". Therefore,\n\
+if you need to display arbitrary strings please use the printf command\n\
+instead.\n\
"), stdout);
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
emit_ancillary_info (PROGRAM_NAME);
--
2.25.1
This bug report was last modified 3 years and 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.