Does the other sed command work for you (sed -i.bak '/\(# Please.*\|# with.*\|^#$\)/ d' $1)? You can also try this one: sed -i.bak '/^# Please/,/^#$/ d' $1
sed
sed -i.bak '/\(# Please.*\|# with.*\|^#$\)/ d' $1
sed -i.bak '/^# Please/,/^#$/ d' $1
To keep things tidy you could make it sed -i.bak '/^# Please/,/^#$/ d' $1 && rm $1.bak
sed -i.bak '/^# Please/,/^#$/ d' $1 && rm $1.bak
Perfect.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Does the other
sed
command work for you (sed -i.bak '/\(# Please.*\|# with.*\|^#$\)/ d' $1
)?You can also try this one:
sed -i.bak '/^# Please/,/^#$/ d' $1
To keep things tidy you could make it
sed -i.bak '/^# Please/,/^#$/ d' $1 && rm $1.bak
Perfect.