Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: scp file from windows10 to unix server

by vinoth.ree (Monsignor)
on Feb 18, 2020 at 12:49 UTC ( #11113101=note: print w/replies, xml ) Need Help??


in reply to Re: scp file from windows10 to unix server
in thread scp file from windows10 to unix server

Hi syphilis

I got not recognized as an internal or external command error when I use just scp.exe instead of absolute path,

I think the problem is that either the source file or the destination (probably the latter) is not being found.

But I am able to run it in cmd line without issues.


All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^3: scp file from windows10 to unix server
by syphilis (Bishop) on Feb 18, 2020 at 13:11 UTC
    I got not recognized as an internal or external command error when I use just scp.exe instead of absolute path,

    If you want to run the command as simply scp.exe or scp then you'll need to add C:/Windows/System32/OpenSSH to the PATH:
    set PATH=%PATH%;C:\Windows\System32\OpenSSH
    But I am able to run it in cmd line without issues

    Yes, I understand that.
    I'm just saying that when I've struck this type of issue in the past, the first approach that haukex suggested of replacing system($cmd) with system(@cmd) has often worked for me.
    That's the first thing I'd be trying.
    Oh ... and use warnings; if they're not already enabled.

    Cheers,
    Rob
Re^3: scp file from windows10 to unix server
by haukex (Bishop) on Feb 18, 2020 at 14:22 UTC
    I think the problem is that either the source file or the destination (probably the latter) is not being found.

    You don't need to guess: As I said, better error handling in Perl will help, and also you can always try things at the command line and compare the errors you get: Try using the command line to copy a file that doesn't exist locally, and to a destination that causes an error.

      Hello haukex,

      I got the issue, I am using this perl script as sourcetree's custom action, though I added this "C:/Windows/System32/OpenSSH" path into PATH env variable, this application is not accounting into the path variable, always keep on says "The system cannot find the path specified." I just copied OpenSSH folder to my home path then it started to work.


      All is well. I learn by answering your questions...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11113101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2020-09-19 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (114 votes). Check out past polls.

    Notices?