-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cut: consistent field list handling for -f (#789)
* handle_b() had been updated with more correct parser for field lists (including sorting fields and ranges) * Move the list-spec parser into its own function and use it in handle_f() for "cut -f" * Output tested against GNU version * test1: echo 'a:b:c:d:e:f' | perl cut -d ':' -f 3,2,2,1 a:b:c * test2: echo 'a:b:c:d:e:f' | perl cut -d ':' -f -2 a:b * test3: echo 'a:b:c:d:e:f' | perl cut -d ':' -f 3 c * test4: echo 'a:b:c:d:e:f' | perl cut -d ':' -f 3- c:d:e:f * test5: printf "a:b:c:d:e:f\nhey\n" | perl cut -d ':' -f 3- c:d:e:f hey * test6: printf "a:b:c:d:e:f\nhey\n" | cut -s -d ':' -f 3- c:d:e:f * test7: printf "a:b:c:d:e:f\n" | perl cut -d ':' -f 100 ["\n" printed]
- Loading branch information
Showing
1 changed file
with
23 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters