vendredi 20 février 2015

sed command to delete two subsequent lines in a file

My file contains lines like



GRANT SELECT ON USER.TABLE1 TO USER1
/
GRANT INSERT ON USER.TABLE1 TO USER1
/
GRANT UPDATE ON USER.TABLE1 TO USER1
/
GRANT DELETE ON USER.TABLE1 TO USER1
/
GRANT SELECT ON USER.TABLE1 TO USER2
/
GRANT INSERT ON USER.TABLE1 TO USER2
/
GRANT UPDATE ON USER.TABLE1 TO USER2


... and so on ...


The sed command I'm seeking, or better, the pattern, that crosses two lines, should delete the "GRANT .." line plus the subsequent line that's starting with the "/".


Any solutions from you sed gurus?


Aucun commentaire:

Enregistrer un commentaire