【问题标题】:Redirection giving Control M in logs在日志中重定向控制 M
【发布时间】:2013-12-19 14:49:30
【问题描述】:

我正在将脚本重定向到日志

test.sh >> 我的日志

test.sh 有

spawn scp -o stricthostkeychecking=no /root/.ssh/id_rsa.pub
root@$IP:/root/.ssh/authorized_keys

我正在获取日志

spawn scp -o stricthostkeychecking=no /root/.ssh/id_rsa.pub root@IP:/root/.ssh/authorized_keys^M
Warning: Permanently added 'IP' (RSA) to the list of known hosts.^M^M
root@10.112.75.21's password: ^M
^Mid_rsa.pub                                      0%    0     0.0KB/s   --:-- ETA^Mid_rsa.pub                                    100%  405     0.4KB/s   00:00    ^M
Host key verification failed.^M
Host key verification failed.^M

将 Control-M 添加到我的日志的原因是什么?重定向时我做错了什么吗?

谢谢你

PS:我所有的系统都是基于unix的系统

【问题讨论】:

  • 我不可能是唯一一个想知道“spawn”命令来自哪里的人。

标签: linux bash shell ssh sh


【解决方案1】:

这很正常。如果您显示任何彩色字符,任何更改标题或在“全屏”模式下工作的应用程序,您将获得更糟糕的 ANSI 序列(转义,...)。 您可以使用colrecode 来操作这样的输出。

这可能是因为 ssh 的选项 -t。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-14
    • 2012-11-08
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多