문제

I am new to Linux environment. I run a sample system command. I am getting the error as "cannot execute binary file". I run the same program in windows but i used batch file to execute exe file. I need to do the same program in linux environment.

sample code:
use strict;
use warnings;
system("/apps01/try.exe");

In this, I need to run the exe file and it should wait till the execution completes.Also i tried,

bash-3.2$sudo perl sample.pl 
/apps01/try.exe: /apps01/try.exe: cannot execute binary file.
도움이 되었습니까?

해결책

If you try to Start an .exe-Application on an Unix-Machine, you need Wine (http://www.winehq.org/). Than should the System-Call work

다른 팁

You're already running the script but try.exe is a Windows executable (plus not found on your linux machine).

Try to run something else.. something executable if you intend to use that function, e.g.

#!/usr/bin/perl
use strict;
use warnings;
my $status = system("vi");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top