I have the following command that I want to execute in the shell of Linux
since php
but it does not work for me, I used exec
, php_exec system
. but nothing.
'iw dev $target station dump | grep Station | cut -f 2 -s -d' ''
I receive as parameter target
from php
and it shows me an error as if the parameters arrived incorrectly I check and it is ok, and changing the variable target
by the card directly works, I do not know if someone can help me . I use php7
and deepinOS
.
this is the function php7.0
function list_connect($interface){
$names = file($interface);
foreach($names as $name)
{
$target = $names[0];
$broadcast = $names[1];
}
$query = "iw dev $target station dump | grep Station | cut -f 2 -s -d' '";
$maclist = shell_exec($query);
var_dump($maclist);
}
list_connect($path_logs_condor_TARGET_LIST);'