How to UNCOMMENT a line that contains a specific string using Sed?

前端 未结 5 533
旧时难觅i
旧时难觅i 2021-01-30 03:11

The lines in the file :

-A INPUT -m state --state NEW -m tcp -p tcp --dport 2000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2001 -j ACCEPT
-A          


        
5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 03:35

    For mac, which doesn't support standard sed parameters, this would remove the hashtag

    sed -i "" "/.*#.*d\/docker-php-ext-xdebug\.ini.*/s/^#//g" docker-compose.yml
    

提交回复
热议问题