Your message dated Sun, 17 Jan 2021 10:05:48 +0100
with message-id <[email protected]>
and subject line Re: Bug#980175: Acknowledgement ("cut -b FROM-TO": wrong byte 
selection)
has caused the Debian Bug report #980175,
regarding "cut -b FROM-TO": wrong byte selection
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
980175: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980175
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: coreutils
Version: 8.32-4+b1
Severity: normal
File: /usr/bin/cut
X-Debbugs-Cc: [email protected]


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

--- End Message ---
--- Begin Message ---
Well, I read the man page, but perhaps only the wrong part.


The top clearly says

DESCRIPTION
     Print selected parts of lines from each FILE to standard output.

so the behaviour is right - just my assumption when reading
"bytes" was wrong.

 [[ "dd bs=1 seek= count=" is awfully slow,
    so I looked for something else -
        and fell into the trap. ]]

Sorry about the noise.

--- End Message ---

Reply via email to