Why does the awk command not produce the same results with simple-quotes and double-quotes?
root@vm90:/root# who | awk "{ print $2 }"
...
root@vm90:/root# who | awk '{ print $2 }'
...
I'd like to use awk in a PHP shell_exec() function, which uses simple-quotes in the entire code.
This ...
$output = shell_exec("who | awk '{ print $2 }'");
... works, but I prefer ...
$output = shell_exec('who | awk "{ print $2 }"');
... this, which doesn't work.