[ubuntu] Grep and Php Shell_Exec

view story

http://ubuntuforums.org – Hey Everyone, I'm having a really hard time figuring this one out. I am running Ubuntu and trying to write a PHP script that will run a grep command that contains a php variable as part of the grep. Example of my code that works: PHP Code: $cmd = shell_exec('cat data.txt | grep -i /11 -B 1 -A 25');  There is other php code that writes the grep results to a file that I have not included since the problem resides in the command above. I want to include a variable called year in my grep comm (Hardware)