LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Skaperen
User Name
Password

Notices


Rate this Entry

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.
Posted in Uncategorized
Views 397 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    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 Skaperen is offline
 

  



All times are GMT -5. The time now is 05:38 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration