【问题标题】:Escaping pipe character in rsh在 rsh 中转义管道字符
【发布时间】:2013-03-21 01:41:03
【问题描述】:

我正在尝试运行此 bash 命令,但无法绕过“|”管道字符

rsh -l user machine "echo "PORTS = 123|456|789" >> conf.cfg"

获取:

bash: 456 >> conf.cfg: No such file or directory

bash: 789: command not found

您知道我如何将PORTS = 123|456|789 回显到远程文件中吗?

谢谢!

【问题讨论】:

    标签: bash rsh


    【解决方案1】:

    只需避开管道和引号:

    rsh -l user machine "echo \"PORTS = 123\|456\|789\" >> conf.cfg"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-24
      • 2014-07-09
      • 1970-01-01
      • 2018-07-24
      • 2023-04-07
      • 2011-07-05
      • 1970-01-01
      相关资源
      最近更新 更多