5

I have a text file that is generated by 3rd-party software as part of a build process. I want to replace one specific line - in my case, line 6. How can I do this in my bash script?

I suspect sed is my friend here but I'm now stumped.

I'm using Mac OS X 10.6 if that's important.

1 Answers1

9

Try sed "6s/old/new/g" file.txt

weeheavy
  • 4,149
  • 1
  • 30
  • 41