【发布时间】:2015-07-22 09:17:54
【问题描述】:
我正在通过 java 运行它。
String cmd = "screen -dmS test -X eval \'stuff \"stop \\015\"\'";
try {
Runtime.getRuntime().exec(cmd);
} catch (IOException e) { e.printStackTrace(); }
它打印为
screen -dmS test -X eval 'stuff "stop\015"'
但是在我尝试运行它的屏幕上,我看到了这个:
-X: Missing ' quote. AND -X: Missing " quote.
引号在哪里丢失?如果我通过控制台运行该命令,它工作正常。
【问题讨论】:
-
当你的字符串中没有变量时,你为什么要使用
+? -
为了转义引号,它会准确地打印出我想要的样子,所以我不确定为什么会出现问题。
-
你使用下面的
String cmd = "screen -dmS test -X eval \'stuff \"stop \\015\"\'"; -
打印效果也很好,但我仍然看到 -X: Missing " quote.
-
它声称丢失了哪一个?在你的问题中,你说'但在你的回复中你说“
标签: java linux gnu-screen