GNU bug report logs - #18987
the bourne shell printf-vs-\xHH portability trap

Previous Next

Package: grep;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Fri, 7 Nov 2014 17:15:03 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 18987 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Aharon Robbins <arnold <at> skeeve.com>
Cc: 18987 <18987 <at> debbugs.gnu.org>, Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Subject: Re: bug#18987: the bourne shell printf-vs-\xHH portability trap
Date: Sat, 8 Nov 2014 12:09:45 -0800
On Sat, Nov 8, 2014 at 11:46 AM,  <arnold <at> skeeve.com> wrote:
> Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
>
>> Thanks, but it seem that it is also unportable.  On Solaris 10 and AIX 7,
>> below.  Need Gawk for tests?
>>
>> $ awk 'BEGIN { printf "\x41" }' </dev/null
>> \x41
>
> If you use octal it should work with any awk.

Thanks, but octal would also work with printf.
My only reason to use awk was because I thought (wrongly)
that it could portably handle that use of hex constants.
The trouble was that I have a strong preference for using hex
constants in the tests.

With the updated patch I sent today, the problem is resolved.




This bug report was last modified 10 years and 198 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.