sed常用操作

发布时间 2023-05-30 17:13:24作者: Peter_Yi
在以location开头的行下添加一行:
sed -i.bak "/^[[:space:]]*location/a\        allow 172.16.0.0/16;" gateway.conf

在以location开头的行上添加一行:
sed -i.bak "/^[[:space:]]*location/i\        allow 172.16.0.0/16;" gateway.conf