Hi,
im wirting the bash script to change the text from configuration file of httpd.conf, In a configuration file there are many similar lines(likely) to configuration. when i change the text using sed its change the other section tooo. how to overcome form this .
eg: -
Code:
$ cat test.txt
# Timeout: The number of seconds before receives and sends time out.
Timeout 60
#KeepAliveTimeout:
KeepAliveTimeout 15
I used this code to change
Code:
sed -i '/^#/!s/Timeout .*/Timeout 45/' test.txt
When i execute this its change both Timeout 60 and KeepAliveTimeout 15 to Timeout 45 and KeepAliveTimeout 45, However i want to change only value of Timeout 60 not the KeepAliveTimeout 15