coreutils
[Top][All Lists]
Advanced

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

Re: cut -DF


From: Shehu Dikko
Subject: Re: cut -DF
Date: Sat, 15 Jan 2022 09:44:57 +0100
User-agent: Mutt/2.1.5 (2021-12-30)

* Rob Landley [2022-01-05] [gmane.comp.gnu.coreutils.general]:
> Around 5 years ago toybox added the -D, -F, and -O options to cut:
>
>     -D  Don't sort/collate selections or match -fF lines without delimiter
>     -F  Select fields separated by DELIM regex
>     -O  Output delimiter (default one space for -F, input delim for -f)
>
> This lets you do:
>
>   $ echo one two three four five six seven eight nine | cut -DF 7,1-3,2
>   seven one two three two

Nice to see that one can specify a range of fields which is not
something that is as straigtforward with awk. I have also seen that it's
undocumented but one can also do the even more useful:

$ echo one two three four five six seven eight nine | cut -DF 1,5-$
one five six seven eight nine

Do please also add the undocumented feature to cut.

For now, it's alias cut='toybox cut'

regards,

s h e h u



reply via email to

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