如运行
$cmd = "export; /usr/bin/sudo /sbin/vgdisplay";
$info = popen($cmd,'r');
echo $info;
得出的是Resource id #17
就是用php的popen()函数运行了一个linux命令,把这个命令得到的结果$info输出出来是Resource id #17,如何把Resource id #17给解析出来。在linux里运行这个命令显示的是
--- Volume group ---
VG Name localhost
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 232.64 GB
PE Size 4.00 MB
Total PE 59557
Alloc PE / Size 59557 / 232.64 GB
Free PE / Size 0 / 0
VG UUID xhGwsx-3SDn-2mgR-XBrE-Nwtt-uJDM-lW7MB1
MM们
杨__羊羊
斯蒂芬大帝