[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf incompatibilities with POSIX, ksh93
From: |
Chet Ramey |
Subject: |
Re: printf incompatibilities with POSIX, ksh93 |
Date: |
Tue, 30 Sep 2003 11:33:50 -0400 |
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
>
> Description:
> Bash's printf command has some incompatibilities with POSIX
> 1003.1-2001 and with ksh93. Here is the POSIX incompatibility:
>
> The remaining issues are not POSIX-conformance issues, but they are
> incompatibilities with ksh93 and with what Standard C programmers
> would expect. Here's the first one:
>
> $ printf '(\x07e)'
> (^Ge)
>
> The C standard says that hexadecimal escapes can have any positive
> number of digits, and ksh93 agrees with this, so it outputs "(~)" for
> this example.
I don't know which version of ksh93 you tested this against, but the
latest available version (ksh.2003-07-24) doesn't behave like you describe:
nike.ins.cwru.edu(2)$ cat x8a
# prints more than two hex digits?
printf '\x07e\n'
nike.ins.cwru.edu(2)$ ksh93 -c 'echo ${.sh.version}'
Version M 1993-12-28 o+
nike.ins.cwru.edu(2)$ ksh93 ./x8a | od -c
0000000 \a e \n
0000003
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/