[BusyBox 0006184]: cut -b behaves identically when given 0 or 1 as start of range (mismatch with coreutils)

bugs at busybox.net bugs at busybox.net
Tue Nov 11 20:44:04 UTC 2008


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=6184 
====================================================================== 
Reported By:                pgbovine
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   6184
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             11-11-2008 12:44 PST
Last Modified:              11-11-2008 12:44 PST
====================================================================== 
Summary:                    cut -b behaves identically when given 0 or 1 as
start of range (mismatch with coreutils)
Description: 
The -b option tells cut to only print certain bytes of the input, and a
number followed by - tells it to go from that byte number to the end of
the line. coreutils thinks that bytes start getting counted at 1, not 0,
but according to busybox, 0 and 1 can be used interchangeably. 

Coreutils behavior:

$ echo "abc" | cut -b0-
<blank line>
pgbovine at hexapod ~/busybox
$ echo "abc" | cut -b1-
abc
$ echo "abc" | cut -b2-
bc
$ echo "abc" | cut -b3-
c

Busybox behavior:

$ echo "abc" | ./busybox cut -b0-
abc
$ echo "abc" | ./busybox cut -b1-
abc
$ echo "abc" | ./busybox cut -b2-
bc
$ echo "abc" | ./busybox cut -b3-
c

seems like '-b0-' and '-b1-' can be used interchangeably, which doesn't
match the coreutils semantics.

====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-11-08 12:44  pgbovine       New Issue                                    
11-11-08 12:44  pgbovine       Status                   new => assigned     
11-11-08 12:44  pgbovine       Assigned To               => BusyBox         
======================================================================




More information about the busybox-cvs mailing list