第一种方式

sed -i "s/替换的目标/替换之后的内容/g" 要进行替换的文件。

 

第二种方式:

echo "要进行替换的字符串"  |  sed -e "s/替换的目标/替换之后的内容/g"

 

第三种方式:


firstStr=$1
secondStr=$2
replacestr=$3

echo "======firststr is ====== ${firstStr}"

echo "======secondstr is ======= ${secondStr}"

echo "${firstStr/$secondStr/$replacestr}"

 

相关文章:

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