hi, I want to add a line to file new.log if /var/log/new.log is not presented in the file.
But it add:
$A_STRING /var/log/new.log
instaed of
local0.debug /var/log/new.log
#!/bin/sh
A_STRING=local0.debug
awk '/\/var\/log\/new.log/{++n}{print}END{if(!n)print "\n$A_STRING /var/log/new.log"}' syslog.conf > tmp.conf
thanks
But it add:
$A_STRING /var/log/new.log
instaed of
local0.debug /var/log/new.log
#!/bin/sh
A_STRING=local0.debug
awk '/\/var\/log\/new.log/{++n}{print}END{if(!n)print "\n$A_STRING /var/log/new.log"}' syslog.conf > tmp.conf
thanks