How to replace an entire line in a text file by line number

I have a situation where I want a bash script to replace an entire line in a file.
The line number is always the same, so that can be a hard-coded variable.

I’m not trying to replace some sub-string in that line, I just want to replace that line entirely with a new line.

Are there any bash methods for doing this (or something simple that can be thrown into a .sh script).

11 Answers
11

Leave a Comment