Skip to main content
added 8 characters in body; edited tags; edited title
Source Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

How can sed be used to make Make multiple in place edits towith a file and only create one backup file?single call to sed

I'm trying to use sed to edit a config file. There are a few lines I'd like to change. I know that sedunder Linux -ised -i allows for in place edits but it requires you save to a backup file. However I would like to avoid having multiple backup files and make all my in place changes at once.

Is there a way to do so with sed -ised -i or is there a better alternative?

Thanks

How can sed be used to make multiple in place edits to a file and only create one backup file?

I'm trying to use sed to edit a config file. There are a few lines I'd like to change. I know that sed -i allows for in place edits but it requires you save to a backup file. However I would like to avoid having multiple backup files and make all my in place changes at once.

Is there a way to do so with sed -i or is there a better alternative?

Thanks

Make multiple edits with a single call to sed

I'm trying to use sed to edit a config file. There are a few lines I'd like to change. I know that under Linux sed -i allows for in place edits but it requires you save to a backup file. However I would like to avoid having multiple backup files and make all my in place changes at once.

Is there a way to do so with sed -i or is there a better alternative?

Source Link
rclark
  • 715
  • 1
  • 5
  • 6

How can sed be used to make multiple in place edits to a file and only create one backup file?

I'm trying to use sed to edit a config file. There are a few lines I'd like to change. I know that sed -i allows for in place edits but it requires you save to a backup file. However I would like to avoid having multiple backup files and make all my in place changes at once.

Is there a way to do so with sed -i or is there a better alternative?

Thanks