Now i just want to remove which ever lines which has below things
1> If the line has 7800 and REJECT string
2> If the line has 3306 and DROP string
3> If the line has 5070 and REJECT or DROP String
i tried below things so far
sed -i '/REJECT\|DROP/d' fileName
but this will remove all DROP and REJECT commands in the file
i also tried below command
sed -i '/*7800*REJECT*\|*5070*DROP\|REJECT*\|*3306*DROP*/d' fileName
its removing but its failing for 3306 and 5070 cum DROP.
After piping , the awk command will just thow output on console... it doesnt do any file write operation.
i have a file - fileName after executing the command it should just remove the patterned lines from this file and save it.. and not to display anything on console...
okay... but as i said before i dont want to redirect to new file... if i redirect to same file the content will be lost.
i just want a command which after executing it, it should remove the lines from that file. Now for the above process i need to execute two command one for redirecting to new file and again copy it to old file or rename the file.