I am trying to pass arguments to a bash script and then to a php script, I have literally looked at 30+ links, and tried over a dozen examples, and I for whatever reason have not been able to get the following to work, I am seriously frustrated, any help is so very much appreciated.
For the sake of this question, lets say I have the following bash script (test.sh)
#!/usr/bin/env bash
/usr/bin/php test.php $@
and I have the following PHP script (test.php)
<?php
print_r($argv);
and I am trying to execute the bash script with the following arguments
./test.sh hello world "how are you"
the results of the above is the following
Array
(
[0] => test.php
[1] => hello
[2] => world
[3] => how
[4] => are
[5] => you
)
and I am looking for the results to be
Array
(
[0] => test.php
[1] => hello
[2] => world
[3] => how are you
)
Any ideas are greatly appreciated... I am banging my head against the desk....