I use the following sed
command to replace text in the file:
sed -i -e 's/noreply@\(.*\).example.com/[email protected]/' cron.yaml
But it create backup of the file cron.yaml
under name cron.yaml-e
.
I tried to move -i
to the end:
sed -e 's/noreply@\(.*\).example.com/[email protected]/' -i cron.yaml
but in this case sed
returns an error.
How should I modify my command line to avoid backup file creation?
According to the man page you should specify a zero length extension on macOS
sed -i '' -e 's/noreply@\(.*\).example.com/[email protected]/'