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: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned 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' -------------------------------------------

Oops!

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
  • -unavailable- added by ericb (Posted a comment)
  • -unavailable- added by kkylheku (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 28 Nov 2009 12:24:27 PM UTCericbStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1