Guest User

Untitled

a guest
Nov 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #Batch Job - AB1234
  2. texts
  3. texts
  4. texts
  5. texts
  6. texts
  7. #--------
  8.  
  9. awk '/#Batch Job.*AB1234/,/#--.*/' filename
  10.  
  11. BATCHJOBNAME=AB1234
  12. awk -v batchjobname=$BATCHJOBNAME '
  13. /#Batch.*/ { f=1 ; m=0 ; res="" }
  14. f { res = res $0 ORS }
  15. f && /Job.*/ && index($2,batchjobname) > 0 { m=1 ;}
  16. /<#--.*>/ { f=0 ; if (m) print res ; }
  17. ' filename
Add Comment
Please, Sign In to add comment