Determine if we should use sed -i or sed -i ''

Close #671