[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
add support to bash for printf "%'d" etc.
From: |
Paul Eggert |
Subject: |
add support to bash for printf "%'d" etc. |
Date: |
Thu, 26 Apr 2001 17:36:46 -0700 (PDT) |
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7'
-DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib
-I/opt/reb/include -g -O2
uname output: SunOS shade.twinsun.com 5.8 Generic_108528-07 sun4u sparc
SUNW,Ultra-1
Machine Type: sparc-sun-solaris2.7
Bash Version: 2.05
Patch Level: 0
Release Status: release
Description:
Draft 6 of POSIX 1003.1-200x says that the shell's "printf" command
must support the use of apostrophe as a flag character in printf
specifications. For example, in a locale that uses "," as a thousands
separator, bash should behave as follows:
$ printf "%'d\\n" 1234567
1,234,567
Repeat-By:
On a Solaris 7 box, run the following commands.
export LC_ALL=en_US
printf "%'d\\n" 1234567
The output should be "1,234,567", but Bash instead outputs
"bash: printf: `'': invalid format character".
Fix:
2001-04-26 Paul Eggert <eggert@twinsun.com>
* builtins/printf.def (SKIP1): Add "'", as POSIX 1003.1-200x d6
requires.
===================================================================
RCS file: builtins/printf.def,v
retrieving revision 2.5
retrieving revision 2.5.0.1
diff -pu -r2.5 -r2.5.0.1
--- builtins/printf.def 2001/02/14 22:09:55 2.5
+++ builtins/printf.def 2001/04/27 00:13:44 2.5.0.1
@@ -76,7 +76,7 @@ extern int errno;
#define PRETURN(value) \
do { /* free (format); */ fflush (stdout); return (value); } while (0)
-#define SKIP1 "#-+ 0"
+#define SKIP1 "#'-+ 0"
#define SKIP2 "*0123456789"
static void printstr __P((char *, char *, int, int, int));
- add support to bash for printf "%'d" etc.,
Paul Eggert <=