in reply to Re^3: Net::OpenSSH quoting problems
in thread Net::OpenSSH quoting problems

Ok so when I use p to look the variable it look correct But, it still not right when I look at the debug from NET::OPENssh The string being sent still has the double \\ and the appliance reject this and I get an error

Replies are listed 'Best First'.
Re^5: Net::OpenSSH quoting problems
by salva (Canon) on May 14, 2014 at 07:24 UTC
    Set $Net::OpenSSH::debug = -1 in order to see what is the module actually sending to the remote host.
      $item =~ s/( \d+-\d+)/\\$1/g; $cmd = "blah blah fred blat $item blah blah blah"; $logger->info("Request data for $item"); ( $output, $errput ) = $ssh->capture2( $cmd ) or $logger->logdie( "Export failed: " . $ssh->error ); $logger->debug("\n$output");
      Debug output
      # call args: ['ssh','-S','/home/testuser/.libnet-openssh-perl/user-10. +10.10.10-10528-606627','-l','user','-p','2024','10.10.10.10','--','bl +ah blah fred blat ITEM\\ 0-17\\ 0-19 blah blah blah'] # open_ex: ['ssh','-S','/home/testuser/.libnet-openssh-perl/user-10.10 +.10.10-10528-606627','-l','user','-p','2024','10.10.10.10','--','blah + blah fred blat ITEM\\ 0-17\\ 0-19 blah blah blah'] # io3 mloop, cin: 0, cout: 1, cerr: 1 # io3 fast, cin: 0, cout: 1, cerr: 1 # stdout, bytes read: 728 at offset 0 #> 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2 +d 5e 0d 0a 73 79 6e 74 61 78 | -----------------------^..syntax
        So, what you get is what you have been asking for.

        The remote command being invoked is blah blah fred blat ITEM\ 0-17\ 0-19 blah blah blah.