0

I'm trying to modify a file using sed. Example file:

apples
bananas
oranges
pears

Using sed I've got:

sed -e '/oranges/i\cherries' -e '1,$s/A/a/' fruit.txt

This just echoes the output to the terminal. The output is in the required format (cherries after bananas, before oranges).

How can I use sed to make the permanent change to the file fruits.txt?

Jelphy
  • 961
  • 2
  • 11
  • 28

0 Answers0