你知道爲什麼這個循環返回目錄列表結果?問題雖然循環Apache狀態
#!/bin/bash
/usr/sbin/httpd fullstatus | while read line
do
echo $line
done
71-0 - 0/0/410 . 7.74 47987 0 0.0 0.00 0.76 127.0.0.1
OPTIONS = bin boot dev error_log etc home lib lib64 lost+found media mnt nohup.out opt proc root sbin selinux srv sys test tmp usr var HTTP/1.0
72-0 - 0/0/103 . 0.14 48912 0 0.0 0.00 0.13 127.0.0.1
OPTIONS = bin boot dev error_log etc home lib lib64 lost+found media mnt nohup.out opt proc root sbin selinux srv sys test tmp usr var HTTP/1.0
它應該只返回apache狀態。
71-0 - 0/0/410 . 7.74 48231 0 0.0 0.00 0.76 127.0.0.1
OPTIONS * HTTP/1.0
72-0 - 0/0/103 . 0.14 49157 0 0.0 0.00 0.13 127.0.0.1
OPTIONS * HTTP/1.0
感謝