Re: parsing out adjacent text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 6/3/2014 11:55 AM, Tim Dunphy wrote:
> Ok this is what I came up with:
>
> #!/bin/bash
> # this script parses mod_status to see which hosts are getting the most
> requests
>
> while true
> do
> echo "Time and date: $(/bin/date +"%D %H:%M:%S")" >>
> /tmp/apache_request_log >> /tmp/apache_request_log
> echo “hostname: $(/bin/hostname -f)\n”   >> /tmp/apache_request_log
> echo “host ip: $(/bin/hostname -i)”   >> /tmp/apache_request_log
> echo "Server Stats: $(/usr/bin/GET `hostname -f`/server-status/?auto |
> /bin/egrep  -i 'kbytes')" >> /tmp/apache_request_log
> echo "Server Stats: $(/usr/bin/GET `hostname -f`/server-status/?auto |
> /bin/egrep  -i 'ReqPerSec')" >> /tmp/apache_request_log
> echo -e "\n"
> sleep 60
> done
>
> Still can't get the echo -e "\n" statement to print a new line for some
> reason. Other than that I'm good. And thanks for everyone's help!

'echo' on it's own should print a new line.  If you want two, why not 
just use two echo lines?

Also, you are piping everything else to the apache_request_log except 
for the last echo line.  Is the problem simply that you forgot to pipe 
that to the log file?

echo -e "\n" >> /tmp/apache_request_log

-- 
Bowie
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos





[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux