Pass command directly to OS
Posted on 2006-11-28
I want to pass a command direct to the terminal. In particular this command:
cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //'
and then have it displayed nice and neatly on the page.
Currently my code looks like this:
$cmd = "cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //' ";
But instead of running I get an error telling me:
Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /var/www/web3/web/network.php on line 4
Does anyone know a way for me to get command to run? I've also tried to echo exec() and popen(), but exec gave me no errors and no output... whilst popen gave me the cryptic output "Resource id #2".
Thanks in advance.