BradV has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm trying to write a perl one liner to search for a specific <Directory ...> entry in httpd.conf, then search for the closing </Directory> and append a CustomLog line after that. I was trying perl -lne '/Directory.*awstats/;s/<\/Directory>/$1\n"CustomLog \/usr\/local\/awstats\/access_log combinedio"/' httpd.conf but that isn't working. Does anyone have a suggestions?
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl one liner to search for a string, then search for a different string and append a new line
by bart (Canon) on Dec 20, 2012 at 11:52 UTC | |
Re: perl one liner to search for a string, then search for a different string and append a new line
by uncoolbob (Novice) on Dec 20, 2012 at 12:08 UTC | |
Re: perl one liner to search for a string, then search for a different string and append a new line
by BradV (Sexton) on Dec 20, 2012 at 13:08 UTC | |
by Athanasius (Archbishop) on Dec 20, 2012 at 13:37 UTC | |
Re: perl one liner to search for a string, then search for a different string and append a new line
by BradV (Sexton) on Dec 20, 2012 at 14:18 UTC | |
by BradV (Sexton) on Dec 20, 2012 at 14:32 UTC |
Back to
Seekers of Perl Wisdom