The output format differs depending on the value of DIGITS in "pr -n"

Solution Unverified - Updated -

Issue

  • The output format differs depending on the value of DIGITS.
(SYSNOPSIS of "-n" option)-----------------------
 -n[SEP[DIGITS]], --number-lines[=SEP[DIGITS]]
  number lines, use DIGITS (5) digits, then SEP (TAB), 
   default counting startswith 1st line of input file
----------------------------------------------

[Case1 : "0" isn't added to front of the line number]
This occurs in case of DIGITS is 1-11, 13-14, 16-17, 20, 25, 28 or 30.

(EX: )
# pr -n11 testfile
2013-01-28 17:34                     testfile                     Page 1
          1 abc
          2 def
          3 ghi
          4 jkl

[Case2 : "0" is added to front of the line number]
This occurs in case of DIGITS is 12, 15, 18-19, 21-24, 26-27, 29 or 31.

(EX: )
# pr -n12 testfile
2013-01-28 17:34                     testfile                     Page 1
000000000001    abc
000000000002    def
000000000003    ghi
000000000004    jkl

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.