In fact that last example I might write as either of the two following ways:
s,$,/, s{$}{/} # this is supported in Perl but not sed
In fact that last example I might write as either of the two following ways:
to avoid having to escape the replacing character.