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.
我在 Unix 机器上,我需要通过 rsh 远程连接到 Windows 机器并列出特定目录中的所有文件。
我读过的大部分代码都非常令人困惑。是否有任何简短的示例如何做到这一点?
rsh $machine -l $user "dir $directory"
应该可以正常工作。
试试这样:
my @files = qx(rsh $machine -l $user "dir $directory");
qx 是一个系统调用,它以数组的形式返回其结果,每行一个条目。
只是出于好奇,你能链接到一个令人困惑的例子吗?