Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么ssh2_exec函数不传递三个以上的参数?
ssh2_exec
$stream_1 = ssh2_exec($ssh, "/root/Script/Auto_Traces/show_ng_trace.sh $a $b $c $d $e");
在这种情况下,只有$a $b $c通过而不是$d和$e,我该如何解决?
$a
$b
$c
$d
$e
我怀疑前 3 个变量中的某些变量中有空格,因此它们被视为多个参数。然后最后两个参数被忽略。如果任何变量中有空格(或其他特殊字符),您应该转义它们。
$ae = escapeshellarg($a); $be = escapeshellarg($b); // repeat for the rest of variables $stream_1 = ssh2_exec($ssh, "/root/Script/Auto_Traces/show_ng_trace.sh $ae $be $ce $de $ee");