Pass php variable to exec
I need to get dimm info using ipmitool as follows:

    exec("/usr/bin/ipmitool -I lan -H $spip -U root -P '$thepassword' sunoem cli 'show System/Memory/DIMMs/$a' | grep -i location", $dimm_loc, $ipmiretval);

$a is previously defined as:
 $a=$dimm[$i]

The return value for the above exec command is 1. If I replace $a with its vaule, i.e 
`exec("/usr/bin/ipmitool -I lan -H $spip -U root -P '$thepassword' sunoem cli 'show System/Memory/DIMMs/D5' | grep -i location", $dimm_loc, $ipmiretval);`

The exec command executes as expected. So it looks like $a cannot be used in the above example. How else can I pass the variable to the exec command?

Thanks!!

Pass php variable to exec
===

I need to get dimm info using ipmitool as follows:

    exec("/usr/bin/ipmitool -I lan -H $spip -U root -P '$thepassword' sunoem cli 'show System/Memory/DIMMs/$a' | grep -i location", $dimm_loc, $ipmiretval);

$a is previously defined as:
 $a=$dimm[$i]

The return value for the above exec command is 1. If I replace $a with its vaule, i.e 
`exec("/usr/bin/ipmitool -I lan -H $spip -U root -P '$thepassword' sunoem cli 'show System/Memory/DIMMs/D5' | grep -i location", $dimm_loc, $ipmiretval);`

The exec command executes as expected. So it looks like $a cannot be used in the above example. How else can I pass the variable to the exec command?

Thanks!!
