Display a block of text with delineated by a start pattern and an end pattern
2009-12-18
56 words
1 min read
Taken idea from commandlinefu.com
The command will display a segment from the file from the start pattern to the end pattern.
function viewsegment() { tail -n +`fgrep -n -m 1 “$1” $3 | head -`fgrep -n -m 1 “$2” $3 }
Display a block of text with delineated by a start pattern and an end pattern
Related Articles:
- 2009/12/07 View the newest xkcd comic.
- 2009/12/05 Insert a comment on command line for reminder
- 2009/11/16 bash colors
- 2009/11/05 Linux xdg-open — replacement for start in windows
- 2009/11/04 Using nullglob and dotglob in bash scripts.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.