AWK Output to file.

I have this awk instructions:

#Interface with description
awk '/hostname/{a=$0} /interface/{b=$0} /address/{print a b $0}' informe-router.txt
awk '/interface/{b=$0} /address/{c=$0} /description/{print b c $0}' informe-router.txt
awk '/router/,/network/{print $0}' informe-router.txt

and I need all output to a file, but if I do this:

awk '/hostname/{a=$0} /interface/{b=$0} /address/{print a b $0}' informe-router.txt > output.txt
awk '/interface/{b=$0} /address/{c=$0} /description/{print b c $0}' informe-router.txt > output.txt
awk '/router/,/network/{print $0}' informe-router.txt > output.txt

take de output for the last instruction, and I need all output.

Thanks for all :b:.

awk '/hostname/{a=$0} /interface/{b=$0} /address/{print a b $0}' informe-router.txt > output.txt
awk '/interface/{b=$0} /address/{c=$0} /description/{print b c $0}' informe-router.txt >> output.txt
awk '/router/,/network/{print $0}' informe-router.txt >> output.txt

You can also try to do all the work in a single awk script.

Jean-Pierre.

Thanks for all!