Print lines in txt file with start and end variable
by dr.x from LinuxQuestions.org on (#5RS9A)
Hello Folks .
I need a way to print the lines in a txt file with top of X and bottom of Y
lets say iptables file below
-A PREROUTING -j X61
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65282 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65283 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65284 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65285 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -j RETURN
I want to print the lines under '-A PREROUTING -j X61'
and above '-A X61 -j RETURN'
So basically I want to have 2 variable UP and down to print the lines below only :
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65282 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65283 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65284 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65285 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
Thanks
I need a way to print the lines in a txt file with top of X and bottom of Y
lets say iptables file below
-A PREROUTING -j X61
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65282 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65283 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65284 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65285 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -j RETURN
I want to print the lines under '-A PREROUTING -j X61'
and above '-A X61 -j RETURN'
So basically I want to have 2 variable UP and down to print the lines below only :
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65282 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65283 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65284 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65285 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
Thanks