Meant to be sed -ri not sed -i

Many thanks to @CurlyMoo for the help.