3

I tried to run script in git bash command line and I saw: "use: command not found" When I changed sh file from './clean_translations.pl' to 'perl ./clean_translations.pl' After that script works.

I have win 8.1. Path is as in other PC (win 7). What should I change to works without 'perl'?

Edit: echo $PATH:

/c/Users/PBI/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/PBI/bin:/c/usr/bin:/c/strawberry/c/bin:/c/strawberry/perl/bin:/c/straw
berry/perl/site/bin:/c/strawberry/c/lib:/c/strawberry/perl/site/lib:/c/strawberr
y/perl/lib:/c/Program Files (x86)/ActiveState Komodo IDE 8:/c/instantclient_12_1
:/c/Program Files/Java/jdk1.8.0_91/bin:/c/Program Files/Java/jre1.8.0_91/bin:/c/
Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/Wind
ows/system32:/cmd:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/Window
sPowerShell/v1.0:/c/Program Files/Intel/Intel(R) Management Engine Components/DA
L:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Prog
ram Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)
/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Tech
nologies/ATI.ACE/Core-Static:/c/Program Files (x86)/GitExtensions:/bin:/mingw64/
bin:/usr/bin/vendor_perl:/usr/bin/core_perl
6
  • What does the bush GIT command do? Commented Jun 6, 2016 at 13:24
  • What does this have to do with Git? Commented Jun 6, 2016 at 14:41
  • What does type -a perl say? Commented Jun 9, 2016 at 6:00
  • $ type -a perl perl is /c/strawberry/perl/bin/perl perl is /c/usr/bin/perl Commented Jun 9, 2016 at 6:02
  • 1
    Then you probably need to put one of those in your #! line. Commented Jun 9, 2016 at 6:05

1 Answer 1

3

You need to use a shebang.

Add this as the first line of the script:

#!/usr/bin/env perl

This conveys that the script should be run using Perl interpreter.

If you are running the script on windows shebang is not parsed. The file extension(.pl) is used to decide the interpreter. In a bash shell shebang is necessary.

Sign up to request clarification or add additional context in comments.

6 Comments

@PiotrBielski, #!/bin/bash executes the script as a bash script. Please modify it as suggested and try
When I used #!/usr/bin/env perl is "No such file or directory" when I changed to #!/usr/bin/ perl is bad interpreter. #!/usr/bin/perl => Command not found
@PiotrBielski, do echo $PATH in git-bash and post the result
@PiotrBielski Like melpomene suggested put one of #!/c/strawberry/perl/bin/perl or #!/c/usr/bin/perl in the first line and try.
With #!/c/usr/bin/perl same problem, with #!/c/strawberry/perl/bin/perl' syntax problem. So it isnt the solution.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.