开发者

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

开发者 https://www.devze.com 2023-03-12 15:47 出处:网络
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.

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

精彩评论

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