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.
我正在尝试使用 PHP SSH2 创建并附加到文本文件。我发送的命令是这样的:
$cmd = "cd $output_directory; cat > myfile.txt; echo \"My Text\" >> myfile.txt";
该文件已创建,但文本未附加到它。
感谢任何关于我哪里出错的意见。
尝试更改cat为touch创建文件。
cat
touch
例子:
$cmd = "cd $output_directory; touch myfile.txt; echo \"My Text\" >> myfile.txt";