sed line range, all but the last line

sed -e "$ ! s/a/b/"

This will match every line but the last. Confirmed with a quick test!

Leave a Comment