1

Hi! I have no problem running

git log --grep="cherry picked" --all > cherrypicklog.txt

from the command line. However it failed to execute in Perl.

my $result = `git log --grep="cherry picked from commit" --all > cherrypicklog.txt`;

git is not recognized as an internal or external command, operable program or batch file.

What am I missing? Thank you.

1 Answer 1

3

I don't know much perl at all but I think this is just a general case of git not being in the PATH environment from your perl script. Try using an absolute path:

my $result = `/path/to/bin/git log --grep="cherry picked from commit" --all > cherrypicklog.txt`;
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your reply. I found the problem is due to the fact that I run it in Eclipse. If I ran it from the shell then it worked fine.
Another question; is there some setting in Eclipse IDE that doesn't get set properly? Because even if I specified the full path, it still failed. For example; my $result = /usr/bin/git log --grep="cherry picked from commit" --all > cherrypicklog.txt ===> The system cannot find the path specified.
Found it. All I have to do was to modify "Run Configuration" in Eclipse IDE.
Cool. Make sure to check the answer if it solved your problem. Glad you found out which environment needed fixing.

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.