bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printf octal literals


From: Chet Ramey
Subject: Re: printf octal literals
Date: Mon, 05 May 2014 10:07:56 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 5/5/14, 7:09 AM, Dan Douglas wrote:
> Just a heads up on something I hadn't noticed: Bash (and dash) treat
> octal literals in printf precision inconsistently (using glibc -- not
> sure if it's a bug or GNUism on that end or the shell):
> 
>     $ bash -c 'printf "<%.010d> <%.*d>\n" 1 010 1'
>     <0000000001> <00000001>

Bash uses the libc printf engine; the printf builtin just marshals
arguments and calls vfprintf.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]