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?
32 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 perlOr run the script using Perl:
perl ../OpenDroneMap/run.plTo 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.plor just use perl for script
perl ../OpenDroneMap/run.plAfter that you can run
0