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.

Submitter:  Kaz Kylheku <kkylheku>
Submitted:  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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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.13-758e.
    Corresponding source code