bugGNU Core Utilities - Bugs: bug #28115, printf breakage: variable...


You are not allowed to post comments on this tracker with your current authentication level.

bug #28115: printf breakage: variable precision: %.*s conversion.

Submitted by:  Kaz Kylheku <kkylheku>
Submitted on:  Sat 28 Nov 2009 11:30:20 AM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Sat 28 Nov 2009 01:05:07 PM UTC, comment #2: 

Oops, sorry about that!

So this is another bash 4 screwup! Second one I ran into today.

Kaz Kylheku <kkylheku>
Sat 28 Nov 2009 12:24:27 PM UTC, comment #1: 

Not a coreutils bug.  There has been no change in this behavior in coreutils' printf:

$ /bin/printf --version | head -n1
printf (GNU coreutils) 6.10
$ src/printf --version | head -n2
printf (GNU coreutils) 8.1.2-f18ee
$ /bin/printf '%.*s\n' 3 -----
$ src/printf '%.*s\n' 3 -----

Rather, what you are probably seeing is that your current shell's printf built-in does not implement the same POSIX extensions as GNU coreutils' printf.

Eric Blake <ericb>
Project Administrator
Sat 28 Nov 2009 11:30:20 AM UTC, original submission:  

Using a coreutils 7.3, I discovered printf breakage:

The following should print 21 dashes.

printf '%.*s\n' 21 -------------------------------------------

It works if the * precision is literally replaced by 21, as in:

printf '%.21s\n' -------------------------------------------


Kaz Kylheku <kkylheku>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by kkylheku (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-11-28 ericb StatusNone => Invalid
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5