PHPでコマンドを実行するとshell_exec
、常に空の文字列が返されます。試し shell_exec('ls -l');
てみましたが、うまくいきました。コマンドを別のファイルとして配置しましたが、それでも同じ結果になります。
$shellOutput = shell_exec("pacmd list-sinks | grep 'volume: 0:' | tail -1 | awk '{ print $3 }'");
//return execute status;
echo trim($shellOutput);