This question already has an answer here:
I added a row to a document with a cat heredocument
cat <<-'DEFINE' >> ./wp-config.php define( 'DISALLOW_FILE_EDIT', true ); DEFINE
I later wanted to remove it and did:
sed -i "s/define( 'DISALLOW_FILE_EDIT', true );//g" ./wp-config.php
After removing it, I noticed an extra empty line where the code was - This is indeed the natural thing to happen - sed just deleted the code, not the whole row.
My question is, can I use sed to actually remove the whole row, and not just the code inside it?