天天看點

BSD Unix/mac使用sed

mac下去使用sed和linux下有點差別

平時我們采用linux的sed是這樣調用的:

sed -i "s/mapi-demo-web/mapi-index-web/g" pom.xml
           

但這樣調用在mac下會出現這樣的報錯

sed: 1: "pom.xml": extra characters at the end of p command
           

查了下mac是unix系統,其調用應該如下:

sed -i "" "s/mapi-demo-web/mapi-index-web/g" pom.xml
           

前面加一個空串

參考連結

繼續閱讀