使用popen()執行shell命令並獲取內容

 1.popen經過管道獲取shell的輸出結果,跟重定向(ls > /test.txt)相似。shell root@Easy-link:~# cat /proc/uptime 67.23 19.08 char*get_uptime() { float hours; FILE *fp; static char buf[16]; fp = popen("cat /proc/up
相關文章
相關標籤/搜索