Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #!/bin/sh
  2. read START
  3. read END
  4. read MATCH
  5.  
  6. REND=$(grep -n "$END" lines | tail -1 | cut -d":" -f 1)
  7. RSTART=$(grep -n "$START" lines | head -1 | cut -d":" -f 1)
  8.  
  9. echo $REND $RSTART
  10. sed $RSTART,$REND!d lines | grep "$MATCH"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement