#1099 format "%05s" 12 returns 12 padded on left with blanks; prev

obsolete: 8.2
closed-fixed
nobody
2
2001-04-05
2000-10-26
Anonymous
No

OriginalBugID: 3992 Bug
Version: 8.2
SubmitDate: '2000-01-10'
LastModified: '2000-01-10'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: HP-UX
OSVersion: HP-UX B.10.20
Machine: HP 9000/892
FixedDate: '2000-01-10'
FixedInVersion: 8.2.3
ClosedDate: '2000-10-25'

Name:
Paul Takemura

Extensions:
protclsh82, Oratcl

Comments:
Perhaps the format command is now working with the correct behavior. I can certainly use "%05d" as a format specifier, but this assumes that I'm formatting an integer (which may not always be the case).

ReproducibleScript:
format "%05s" 12

ObservedBehavior:
returns bbb12 (where 'b' represents blank)

DesiredBehavior:
In the past, the command has returned 00012

This was already fixed in an 8.2 patch release (for sure 8.2.3),
but it should be noted that the user is relying upon "undefined"
behavior (according to ANSI spec), so we just made it work like
8.0, but this behavior is still undoc'ed.
-- 01/10/2000 hobbs

Discussion

  • Brent B. Welch

    Brent B. Welch - 2000-10-26
    • priority: 5 --> 2
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2001-04-05
    • labels: 104238 --> 16. Commands A-H
    • summary: format "%05s" 12 returns 12 padded on left with blanks; prev --> format "%05s" 12 returns 12 padded on left with blanks; prev