sed替换的两种写法,今天看脚本的时候遇到了一个没见过的写法:

用;替代/的

如下:

 

root@iZ2zegl8h62gwjeuf4d47lZ:~# echo "hello;nihao" | sed -e 's;\;;:;g'     #####   ;代替了 /  等同于下面的写法

hello:nihao

root@iZ2zegl8h62gwjeuf4d47lZ:~# echo "hello;nihao" | sed -e 's/\;/:/g'

hello:nihao

相关文章:

  • 2021-08-04
  • 2022-01-07
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-24
  • 2021-12-05
  • 2021-05-24
  • 2021-12-13
  • 2021-05-17
相关资源
相似解决方案