Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Batch Job - AB1234
- texts
- texts
- texts
- texts
- texts
- #--------
- awk '/#Batch Job.*AB1234/,/#--.*/' filename
- BATCHJOBNAME=AB1234
- awk -v batchjobname=$BATCHJOBNAME '
- /#Batch.*/ { f=1 ; m=0 ; res="" }
- f { res = res $0 ORS }
- f && /Job.*/ && index($2,batchjobname) > 0 { m=1 ;}
- /<#--.*>/ { f=0 ; if (m) print res ; }
- ' filename
Add Comment
Please, Sign In to add comment