【问题标题】:how to use Sed to add spicial charectar?如何使用 Sed 添加特殊字符?
【发布时间】:2022-11-02 20:05:28
【问题描述】:

如何使用 Sed 添加特殊字符?

脚本外壳:挑战是:

我有一个大文件 xx.html:

... ... ...

我的问题是如何使用 sed 命令插入这一行: 安全令牌 = '' 函数 getipInfo()

到 xx.html 文件之前

</body>  line


I try to much scinario , alwase there is issue in php charectar 

sed -i '102i secure_token = \'\<\?php \e\cho file_get_contents\(\"token.txt\"\); \?\>\'\n
   function getipInfo()' xx.html



【问题讨论】:

    标签: linux shell scripting


    【解决方案1】:

    如何插入

     secure_token = '<?php echo file_get_contents("token.txt"); ?>'    function getipInfo()
    

    使用 sed 进入文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-09
      • 2019-05-14
      • 1970-01-01
      • 2011-05-17
      • 1970-01-01
      相关资源
      最近更新 更多