Hi.
I would like to remove arbritary text from a file, ideally acting on one file in place.
IE
this file:
2+12345+/bin/cat /etc/passwd | /bin/grep -i bash
3+14445+/bin/cat /etc/svc.conf | /bin/grep -i telnet
4+17376+/bin/cat /etc/hosts | /bin/grep -i server
becomes
2+12345+/bin/cat /etc/passwd | /bin/grep -i bash
4+17376+/bin/cat /etc/hosts | /bin/grep -i server
by removing the middle line (but I can't assume an order to the lines or that they will be incremental)
Any ideas?
I really like to act on the one file in place. I can do this in sed with 2 files easily, and I can't figure out how to do it in ed. I am open to awk or anything else that can act on the file in place. I am using Linux, BTW...
Thanks!
-john
I would like to remove arbritary text from a file, ideally acting on one file in place.
IE
this file:
2+12345+/bin/cat /etc/passwd | /bin/grep -i bash
3+14445+/bin/cat /etc/svc.conf | /bin/grep -i telnet
4+17376+/bin/cat /etc/hosts | /bin/grep -i server
becomes
2+12345+/bin/cat /etc/passwd | /bin/grep -i bash
4+17376+/bin/cat /etc/hosts | /bin/grep -i server
by removing the middle line (but I can't assume an order to the lines or that they will be incremental)
Any ideas?
I really like to act on the one file in place. I can do this in sed with 2 files easily, and I can't figure out how to do it in ed. I am open to awk or anything else that can act on the file in place. I am using Linux, BTW...
Thanks!
-john