I have a shell script deploy.sh
that has the following content:-
echo "0 Importing the code"
eval "git pull -u origin master"
echo "1 Backing up existing data in database.."
// -- other code follows here
When I execute the script directly using the terminal, I get the following output:-
0 Importing the code
remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From bitbucket.org:user/repo * branch master -> FETCH_HEAD Updating db13xxx..6705xxx
1 Backing up existing data in database..
This is correct. However, I wrote a PHP script with which I can invole the deploy.sh script over http. Content of this php page is as follows:-
$output = `./deploy.sh`;
echo '<pre>', $output, '</pre>';
When I invoke this php file through the browser, the shell script is in fact getting invoked and I'm getting the following output:-
0 Importing the code 1 Backing up existing data in database..
The problem is that the eval "git pull -u origin master"
command didnt get executed and its output is not shown. Any idea what the problem is?