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: field list semantics for -b #596

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented May 9, 2024

  • These 3 test cases agree between GNU and OpenBSD, but this version of cut didn't work properly
  • Multiple bytes can be separated by commas
  • A negative number means a range 1-x
  • Two numbers joined by dash means a range x-y
  • If the same byte number is repeated, only print it once
  • test1: "perl cut -b 1,1,1,3,1 a.c" --> interpret as -b 1,3
  • test2: "perl cut -b 1,1,1,-3,1 a.c" --> interpret as -b 1-3
  • test3: "perl cut -b 1,1,1,3,2-4 a.c" --> interpret as -b 1-4

* These 3 test cases agree between GNU and OpenBSD, but this version of cut didn't work properly
* Multiple bytes can be separated by commas
* A negative number means a range  1-x
* Two numbers joined by dash means a range x-y
* If the same byte number is repeated, only print it once
* test1: "perl cut -b 1,1,1,3,1 a.c" --> interpret as -b 1,3
* test2: "perl cut -b 1,1,1,-3,1 a.c" --> interpret as -b 1-3
* test3: "perl cut -b 1,1,1,3,2-4 a.c" --> interpret as -b 1-4
@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 May 9, 2024
@briandfoy briandfoy self-assigned this May 9, 2024
@briandfoy briandfoy merged commit 07c717a into briandfoy:master May 9, 2024
1 of 2 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels May 10, 2024
This pull request was closed.
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: accepted The fix is accepted Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants