Alex van den Bogaerdt wrote:
> Remark about your script:  in almost all cases, you need not combine
> 'grep' and 'awk' and 'sed'.
>
> Some examples:
>
> wrong: grep 'x' | awk '{print $1}' 
> good:  awk '/x/ {print $1}'
>
> wrong: grep 'x' | sed 's/x/y/g'
> good:  sed -n '/x/s/x/y/gp'
>
> wrong: grep 'x' | awk '{print $1}' | sed 's/x/y/g'
> good:  awk '/x/{gsub("x","y",$1);print $1}'
>   

Excellent advice. I've never been so good at sed/awk... I'll take some 
notes here...
Thanks.

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to