You are correct about your variable within the '' not being seen. PHP interprets strings in '' differently than those in "". Easy way is to just change to "" and then the variable substitution happens.
Hi there Marshall, thanx for the help , the "" sorted out the problem . Do you know of any resources that would explain the difference between '' & "" . I thought that the reason might be that when shell_exec('ping blahblah'); would be because the linux shell stores it's variables in "" opposed to '' .