Problem executing bash file
Posted
by sandelius
on Stack Overflow
See other posts from Stack Overflow
or by sandelius
Published on 2010-04-01T09:04:01Z
Indexed on
2010/04/01
9:13 UTC
Read the original article
Hit count: 384
HI there!
I've run into some problem while learning to combine .sh files and PHP. I've create a file test.sh and in that file I call a PHP file called test.php.
If I double click on the .sh file then it runs perfectly but when I try to run it from the terminal I get "command not found". I'm in the exact folder as my .sh file but it wont work. Here's my test.sh:
#!/bin/bash
LIB=${0/%cli/}
exec php -q ${LIB}test.php one two three
exit;
When I doubleclick on the test.sh file then it returns the argv array like it suppost to. But why can't I run it from terminal?
© Stack Overflow or respective owner