I have a simple system command to copy file from one folder to another:
my $cmd = "xcopy /Y c:\DBs\Support\db.bak c:\jenkins\workdir\sql-bak-files";
When I try to run the following system commands, all fails:
1. my $res = qx/$cmd/;
2. my $res = qx($cmd);
3. using back ticks
All tries returned the error: Error number -1, error message: "Bad file descriptor".
When trying to use system($cmd) the error was Error number 65280, error message: "No such file or directory".
This perl code is running via Jenkins (ver 2.190.1) and perl v5.26.0. This problem started after migrating the code from mercurial to git, but I don't think it's related. It worked before, but now always fail :(
$!("No such file or directory") is meaningless when the error isn't-1. 65280 (0xFF00) means the child ran, but returned exit code 255 (0xFF)