Skip to content

cut: the '=' after a short option is dropped from its value #16436

Open

Description

@binhvq

GNU takes everything after a short option letter as its value, including a leading =. uutils drops the = (except for the special-cased -d=), so these behave differently:

$ printf 'a=b,c\n' | cut -b=1; echo $?
a
0
$ printf 'a=b,c\n' | cut -d=x -f1; echo $?
a=b,c
0
$ printf 'a,b\n' | cut -d, -f1,2 -O=x
axb

GNU 9.12:

$ printf 'a=b,c\n' | cut -b=1; echo $?
cut: invalid byte/character position '=1'
Try 'cut --help' for more information.
1
$ printf 'a=b,c\n' | cut -d=x -f1; echo $?
cut: the delimiter must be a single character
Try 'cut --help' for more information.
1
$ printf 'a,b\n' | cut -d, -f1,2 -O=x
a=xb

Same for -c=, -f= and -F=.

Activity

  1. asxxb commented on Nov 27, 2026

    @asxxb

    Hi! I'd like to work on this issue. Is it still available? I'd be happy to submit a fix and tests.

  2. binhvq commented on Nov 27, 2026

    @binhvq
    ContributorAuthor

    Sure, it's free, go ahead. My attempt was #16437; I closed it because I couldn't get clap to keep the = and rewriting argv before parsing got too long. The review comments there might save you some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions