sed之打点计数器
将第二行的dns nameserver注释掉
sed -r '/nameserver/{
x;
s/^/./;
/^\.{1}$/x;
/^\.{2,}$/{x;s/^/; /};
}' /etc/resolv.conf
将第二行的dns nameserver注释掉
sed -r '/nameserver/{
x;
s/^/./;
/^\.{1}$/x;
/^\.{2,}$/{x;s/^/; /};
}' /etc/resolv.conf