2

I have a script in a file .bat that I need to run in Ubuntu's terminal. I run it ($./execute.bat) and I get the following error in a line:

"Could not open input file: prepare.php"

In the line inside the file, there is the command:

php prepare.php

The file prepare.php is in the same directory of execute.bat and has all permissions (chmod 777)

Why I get this error and how can I solve it?

4
  • Please post some code, the .bat for example. Commented Jul 14, 2014 at 13:56
  • see carefully permitions Commented Jul 14, 2014 at 13:57
  • 1
    .bat is a windows-ism. is that execute.bat a properly constructed shell script, with a shebang and all? Commented Jul 14, 2014 at 16:38
  • Thanks. I added, at the first line: #!/bin/sh. Then, I converted the file into a .sh and worked. Commented Jul 14, 2014 at 20:59

1 Answer 1

1

You are getting the error because the bat file cannot open prepare.php due to permissions.

Set the right permissions on prepare.php and it should be fine.

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

1 Comment

I set all permissions for prepare.php (chmod 777) and still get the same error.

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.