Package: coreutils
Version: 8.32-4+b1
Severity: normal
File: /usr/bin/cut
X-Debbugs-Cc: phil...@marek.priv.at


Yeah, I read the manpage - "cut" counts from 1 ;)

When using the "FROM">1 in "cut -b FROM-TO", the output is wrong:

    $ openssl rand 16777216 > /tmp/zeroes
    $ cut -b1-12000000 < /tmp/zeroes > /tmp/zeroes2                             
                                                                 
    $ ls -la /tmp/zeroes*
    -rw-r--r-- 1 user user 16777216 15. Jän 17:53 /tmp/zeroes
    -rw-r--r-- 1 user user 16777217 15. Jän 17:53 /tmp/zeroes2
    $ cut -b65-12000000 < /tmp/zeroes > /tmp/zeroes2
    $ ls -la /tmp/zeroes*                                                       
                                                       
    -rw-r--r-- 1 user user 16777216 15. Jän 17:53 /tmp/zeroes
    -rw-r--r-- 1 user user 13075377 15. Jän 17:53 /tmp/zeroes2
    $ cut -b2-12000000 < /tmp/zeroes > /tmp/zeroes2                             
                                                                                
 
    $ ls -la /tmp/zeroes*                                                       
                                                        
    -rw-r--r-- 1 user user 16777216 15. Jän 17:53 /tmp/zeroes
    -rw-r--r-- 1 user user 16711969 15. Jän 17:53 /tmp/zeroes2

It doesn't happen with /dev/zero - so I guess some byte value isn't sent 
through properly (NUL, or CRLF mismatch or something like that?).

Anyway, with byte positions I'd expect it to be clean and not do
any processing!


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-1-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_WARN
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_AT:de
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages coreutils depends on:
ii  libacl1      2.2.53-9
ii  libattr1     1:2.4.48-6
ii  libc6        2.31-9
ii  libgmp10     2:6.2.1+dfsg-1
ii  libselinux1  3.1-2+b2

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

Reply via email to