By estis , 12 4月, 2020 URL表記を sed で加工したい http:// あるいは、 https:// を https?:// に example.php は、 example\.php のように、 . が何か一文字ではなく . そのものを現すように http://example.com/path/to/file を http://example.com\/path\/to\/file に sed -e 's/https\{0,1\}:/https?:/' -e 's/\./\\./g' -e 's:/:\\/:3g' で、いいみたい。
By estis , 14 4月, 2019 sed で、[] を消去 sed で [] (角括弧・ブラケット)を削除したい。 $ echo "[KVM]" | sed -e 's/[][]//g' KVM のように、[ ] の中で指定することで、] と [ が対象になり、 g オプションで、対象文字列の [ と ] に適用され、無事削除される。