daily pastebin goal
86%
SHARE
TWEET

Untitled

a guest Nov 24th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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"
RAW Paste Data
Top