Mailing List Archive


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

Re: [tlug] Alternatives to sed + awk



On 4 March 2011 01:57, David Blomberg <dblomber@example.com> wrote:

>>> root@example.com:~$ while true; do wc -l /tmp/lauch_code_ripper.log |
>>> cut -d' ' -f 1 | perl -ne 'chomp; printf "%.02f%% ", "$_.0" /
>>> 596058.0'; sleep 15; done
>>> 0.01% 0.01% 0.01% 0.02% 0.02% 0.02% 0.02% 0.02% 0.02% 0.02% ...
>>
>> A free beer* goes to the first person to find the bug.
>
> You mean besides that your cut is going to return and empty string...

Nope, the cut works just fine. I realise that on some systems, wc(1)
will try to format the output "nicely" (that is so annoying!), so I
could write:

wc -l /var/log/kernel.log | perl -ne '/^\s*(\d+)\s/; printf "%.02f%%
", "$1.0" / 596058.0'

But the bug that caught my attention is still there. :)

David, you get a small beer of your choice. But the 大瓶 is still up for grabs.

--Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links