开发者

How can I connect to a remote machine and list all files in a directory?

I am on a Unix m开发者_运维问答achine, and I need to remotely connect, via rsh, to a Windows machine and list all the files in a particular directory.

Most of the code I've read is really confusing. Are there any short examples how to do this?


rsh $machine -l $user "dir $directory" 

should work fine.

try it like this:

my @files = qx(rsh $machine -l $user "dir $directory");

qx is a system call that returns its results as an array, one entry per line.

Just out of curiosity, can you link to a confusing example?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜