Thursday, 19 September 2013

Replace result from awk

Replace result from awk

Basically, what I want to do is replacing a result parsed from awk with
something else. I have the following awk command :
awk '$1~/^DocumentRoot/{print $2}' /etc/apache2/sites-available/default
Which returns :
/var/www/
What I want to do is replace the /var/www/ (of course, it can be anything
and not /var/www/ in particular) in the file. I tried to pipe a sed
command, but I can't figure out how to do it...
Anyone can help ?

No comments:

Post a Comment