Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed comment line number x to y from files

Tags:

linux

bash

sed

I am having a software which when running ../configure is failing due to some checks.

I have find a way to comment out the lines 49725-49735 manually then I can install the software just fine.

I need to edit the configuration file automatically and comment those lines.

Is there anyone who can give me a hint how to achieve that?

like image 455
zozo6015 Avatar asked Oct 27 '25 07:10

zozo6015


1 Answers

Not advisable to edit config files like this (fix the error messages), but you know your situation better than I do.

sed '49724,49736 {s/^/#/}' file > newFile && mv newFile file

IHTH

like image 90
shellter Avatar answered Oct 28 '25 22:10

shellter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!