in reply to Re^3: scp recommendations
in thread scp recommendations

# No good on Windows sub text_to_shell_lit { my ($s) = @_; $s =~ s/'/'\\''/g; return "'$s'"; }
my $cmd = join ' ', map text_to_shell_lit($_), scp => '-t', @args; system(ssh => $cmd);

Replies are listed 'Best First'.
Re^5: scp recommendations
by salva (Canon) on Aug 02, 2010 at 07:38 UTC
    well, actually it should be...
    my $quoted_to = text_to_shell_lit($to); system 'scp', '--', $from, "${host}:$quoted_to";
    or
    my $quoted_from = text_to_shell_lit($from); system 'scp', '--', "${host}:$quoted_from", $to;
      Oh! I see what you were saying now.