Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /usr/xpg4/bin/awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=5 a=5 s="ERROR" file
- stupid
- remove
- keep it
- *
- MATCH
- keep it as well
- remove
- important
- *
- MATCH at line 2:
- needed
- also
- this line should be kept
- *
- MATCH at line 2:
- this to save
- very important
- remove
- keep it
- *
- MATCH
- keep it as well
- nonsense
- another nonsense
- keep it
- keep it as well
- ---
- important
- needed
- also
- ---
- this line should be kept
- this to save
- very important
- ---
- keep it
- keep it as well
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement