To comment the line that starts with
DROP TABLE IF EXISTS, just do
perl -i~ -pe 'print "-- " if /^DROP TABLE IF EXISTS/' db_backup.sql
- -i~ creates a backup file;
- -p processes the file line by line, printing each line;
- the code itself prepends -- to a line if it starts (^) with the given statement.