0

I am on a Unix machine, 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?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
kurt
  • 11
  • 3
  • rsh??? Without knowing what you hopre you achief, why don't you use smbclient to list your files? – pavel Jun 10 '11 at 19:09

1 Answers1

1
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?

MikeEL
  • 674
  • 5
  • 13