coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cut -DF


From: Rob Landley
Subject: Re: cut -DF
Date: Tue, 25 Jan 2022 15:32:39 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 1/25/22 1:55 AM, Assaf Gordon wrote:
> Hello,
> 
> Here's an updated patch for "cut -DF".
> Since it's a new code path, it opens the possibility of finally 
> supporting multibyte characters with "cut -c".

Don't forget -nb (posix!). Toybox's rounds down to the start of character for
both beginning and end of range. (So left edge is increased, right edge is
decreased.)

One comment:

+The @option{-F} option implies @option{-s}.

In toybox and busybox -D implied -s. -F worked exactly like -f, just with 
regexes.

-D disables the reordering and line suppression so cut works like other tools:

$ echo -e 'alpha\nping\nbeta\ngamma' | sed 's/a//g'
lph
ping
bet
gmm
$ echo -e 'alpha\nping\nbeta\ngamma' | tr a x
xlphx
ping
betx
gxmmx
$ echo -e 'alpha\nping\nbeta\ngamma' | nl -bpa
     1  alpha
       ping
     2  beta
     3  gamma

Rob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]