Trying to execute a run.pl file

I am trying to run a run.pl file form the OpenDroneMap directory using the command ../OpenDroneMap/run.pl from within the Photos directory however I keep getting a Bash error.

Would there be any reason I can't run this command?

3

2 Answers

Bash will always try to interpret scripts / text files as a sequence of Bash commands, unless the script / text file itself has a shebang at the start of the file describing which executable has to be run in order to interpret it; either add a shebang at the start of the file explicitly telling Bash to run the script using Perl:

#!/usr/bin/env perl

Or run the script using Perl:

perl ../OpenDroneMap/run.pl

To not follow a reverse SCITE approach (i.e. to not edit answers posted earlier based on other users' answers posted later), since this is now the accepted answer I'll edit in part of what OleksDovz said in its answer, which is: if you're running the script using ../OpenDroneMap/run.pl, make sure that the script has both a shebang at the start of the file and the executable flag set for your user; if you're the owner of the file run:

chmod u+x ../OpenDroneMap/run.pl

check if shebang exists in first line, Like "#!/usr/bin/perl" and add to this file +x bit:

chmod a+x ../OpenDroneMap/run.pl

or just use perl for script

perl ../OpenDroneMap/run.pl

After that you can run

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like