in reply to Problem with Net::SCP::Expect

I have not tested it, but reading the documentation it seems that Net::SCP::Expect, by default, quotes the arguments passed to scp and so, wildcard characters will not be expanded by the shell. Try adding auto_quote => 0 to the constructor call.

You can also try using other Perl packages as Net::SSH2 or Net::OpenSSH.

Replies are listed 'Best First'.
Re^2: Problem with Net::SCP::Expect
by xorl (Deacon) on Feb 23, 2009 at 15:54 UTC

    The auto_quote thing didn't work :(

    I'm on RHEL 3 and there isn't a libssh2 package for Net::SSH2

    I'm trying Net::OpenSSH now. However it is complaining:

    "ssh: illegal option -- M"

    Any suggestions?

      The auto_quote thing didn't work :(

      Try running the script with strace to see how it calls the scp program.

      I'm trying Net::OpenSSH now. However it is complaining: "ssh: illegal option -- M"

      That probably means that the version of OpenSSH installed on the machine is too old for Net::OpenSSH. It requires OpenSSH 4.1 or later (5.1 is recommended).

      update: BTW, could you use SFTP instead of SCP?

        I finally gave up and went with crafting the right scp command and using the system command to run it. Probably not the right thing to do, but it is working. If someone gives me a good reason why this is a horrible plan, I'll give SFTP a try. Update: Yes I had to set the boxes up to scp without a password.