你知道为什么这个循环会返回目录列表结果吗?
#!/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
谢谢