Forum Moderators: coopster

Message Too Old, No Replies

running shell commands through php

run shell commands from php

         

vwsequeira

3:29 pm on Jun 9, 2009 (gmt 0)

10+ Year Member



Hi,

I am trying to run shell command from php but shell_exec function doesnt substitute the parameters passed to it.

$vin=shell_exec('runcom.sh $feedname $dte') hee $feedname and $dte are not substituted by php automatically so that shell script can grab them.

anyone please help me with this to rectify this problem

Little_G

3:32 pm on Jun 9, 2009 (gmt 0)

10+ Year Member



Hi,

If you want php to expand variables inside the string you need to use double quotes [php.net] around the string instead of single.

Andrew

[edited by: Little_G at 3:34 pm (utc) on June 9, 2009]

vwsequeira

3:39 pm on Jun 9, 2009 (gmt 0)

10+ Year Member



Thanks little g, new to php , appreciate your quick help