This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

echo -e (was: Do not report build errors in bugzilla)


Ulrich Drepper <drepper@redhat.com> wrote:
> Paul Jarc wrote:
>> SUSv3 doesn't specify -e or -E for echo,
>
> ...and still you send the patch using it.

-e is already used in csu/Makefile, so my patch doesn't introduce any
new portability problems by using -e again.  It just fixes another
problem: the incorrect assumption that -e is not the default behavior.
Whatever solution is used to avoid the existing -e can also be used to
avoid the new ones.

Are there any other problems that also must be fixed in the same patch
in order for this fix to be accepted?

> I wrote before that a correct change would test for bash and use
> shopt to enable the xpg echo behavior.

Sorry, I didn't see (or don't remember) that message.  Exactly how
portable is csu/Makefile intended to be?  For example, FreeBSD/NetBSD
behave like bash by default, but don't have shopt.  Here are the
platforms I have access to:

          default behavior   recognizes -e   recognizes -E   has shopt
bash      -E                 yes             yes             yes
pdksh     -e                 yes             no              no
OpenBSD   -e                 yes             yes             no
FreeBSD   -E                 yes             no              no
NetBSD    -E                 yes             no              no
Solaris   -e                 no              no              no

Using -e whenever there is a backslash produces consistent behavior
for all but Solaris.  Solaris is hopeless if you want to keep using
the system's own echo (builtin or external) command.  It's easy enough
with a ./echo script, though:

#!/bin/sh
cat <<EOT
$*
EOT


paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]