我正在通过 ssh 连接到服务器以从日志文件中读取时间。它失败了,我想知道我哪里出错了。我认为我没有正确地转义某些内容?
LastBroken= $(ssh ${UserLogin}@${ServerName} -p${PortNumber} "grep 'BROKEN' /scripts/SSHtoDo.log | tail -1 | head -1 | awk '{ print \$2, \$3, \$4, \$5, \$6 }'")
LastRestarted= $(ssh ${UserLogin}@${ServerName} -p${PortNumber} "grep 'RESTARTED' /scripts/SSHtoDo.log | tail -1 | head -1 | awk '{ print \$2, \$3, \$4, \$5, \$6 }'")