A feature i would like to add to head and tail
Posted 03-10-2021 at 08:39 PM by Skaperen
i would like to add a -m option to both the head and tail commands. it would be a regex match where head will output until it has a line that matches and tail will output from after the last line that matches, to the EOF. an option -M can be an inclusive variant that also outputs the matched line in the proper order. another option might be picked to do non-regex matching.
Total Comments 1
Comments
-
another way to do this is to improve the -n option instead of adding the -m option. the -n option usually has a number. i would have -n support the @ character followed by the regex (and the ! character followed by a fixed string) and let that do the search.
Posted 03-11-2021 at 05:13 PM by Skaperen