Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cut: -b 0 and -f 0 are invalid #299

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Oct 21, 2023

  • cut's -f value can be a comma-separated list of field numbers starting from 1
  • The following is valid for selecting x+z: echo 'x:y:z' | perl cut -d ':' -f 1,3
  • GNU cut and OpenBSD cut reject 0 as part of a field list so do the same here
  • Now -f 0,1 and -f 1,0 will raise an error as expected
  • Same treatment for -b 0,1 (bytes also count from 1)
  • Style: replace 2 dies with warn+exit

* cut's -f value can be a comma-separated list of field numbers starting from 1
* The following is valid for selecting x+z: echo 'x:y:z' | perl cut -d ':' -f 1,3
* GNU cut and OpenBSD cut reject 0 as part of a field list so do the same here
* Now -f 0,1 and -f 1,0 will raise an error as expected
* Same treatment for -b 0,1 (bytes also count from 1)
* Style: replace 2 dies with warn+exit
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: cut The cut program labels Oct 21, 2023
@briandfoy briandfoy self-assigned this Oct 23, 2023
@briandfoy briandfoy merged commit 02e726f into briandfoy:master Oct 23, 2023
2 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Oct 23, 2023
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: cut The cut program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants