使用cli args调用php脚本的bash脚本

I need to write a bash script that wraps a php script, I have some variables that needs to be forwarded to the php script and some variables that I need internally for the bash script it self.

The call for the shell script should look like that but the php file can have more params so it needs to be generic :

bash  /tmp/test.sh -c -l /tmp/aaa -php aaa.php -d -p 3 -f 2012-10-23

the -php option is mandatory because it contains the php file that needs to be called the -c and -l are optional flag and needs to be used internally for the bash script, everything after the aaa.php are params for the php file.

bash /tmp/test.sh -c -l /tmp/aaa -php "aaa.php -d -p 3 -f 2012-10-23" ?

Don't know how you are passing anythin inside bash script, bu basically everything wrapped in apostrophes is treated as one argument in bash script, passed further to php interpreter is seen as separated parameters, unless of course you don't wrap it again.