Hi,
Please help me to write an awk or sed statement that do:
1. if see any line that started with "local0." (local0 follow by a dot) replace the entire line with "local0.debug /var/test"
2. If I dont see any line that started with "local0." append "local0.debug /var/test" to the file
here is that I have but It only append(2) but not replace(1)
awk '/^local0./{++n}{print}END{if(!n)print "\nlocal0.debug \/var\/test"}' syslog.conf > syslog.conf.11
Please help
Please help me to write an awk or sed statement that do:
1. if see any line that started with "local0." (local0 follow by a dot) replace the entire line with "local0.debug /var/test"
2. If I dont see any line that started with "local0." append "local0.debug /var/test" to the file
here is that I have but It only append(2) but not replace(1)
awk '/^local0./{++n}{print}END{if(!n)print "\nlocal0.debug \/var\/test"}' syslog.conf > syslog.conf.11
Please help