Mailinglisten-Archive |
TimTaler schrieb:
> Tobias Fichtner schrieb:
>
>> TimTaler schrieb:
>>
>>
>>
>>> Tobias Fichtner schrieb:
>>> Moin
>>>
>>> $foo = shell_exec('tar -h');
>>> print '<pre>' . $foo . '</pre>';
>>>
>>> sollte was ausgeben... zumindest etwas wie "tar - command not found"
>>>
>>> LG Tim
>>>
>>>
>>>
>> Das erzeugt dann nur:
>> <pre></pre>
>>
>>
>>
> Sorry .. [...]
>
>
Lässt mir keine Ruhe :-) Ich wusste doch, das man via shell auch was
ausgeben kann.
<?
function shell_output($command){
if ($proc = popen("($command)2>&1","r")){
while (!feof($proc)) $result .= fgets($proc, 1000);
pclose($proc);
return $result;
}
}
print shell_output('tar --help');
?>
bis die Tage, Tim
> LG, Tim
>
>
>> LG Tobias
>>
>>
>
>
php::bar PHP Wiki - Listenarchive