help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Annihilating data


From: Paul-Jürgen Wagner
Subject: [Help-bash] Annihilating data
Date: Fri, 02 Nov 2018 19:56:09 +0100
User-agent: Posteo Webmail

Dear Bashers,

I have a pipe who's last command ('analyse') should throw away the data for a specified amount of time ('end') and then start processing it. My current solution is

function analyse {
        local count=<some sensible number>
        while (( $(date '+%s') < end ))
        do
                dd bs=1024 count=$count status=none iflag=fullblock of=/dev/null
        done
        <now the magic starts>
}

This works reasonably, but I am pretty sure that there is a much smarter solution to this, probably by using cat, putting it in the background, sleeping for the skip-duration and then killing it? Any comments or tips?

Thanks a lot,

Paul





reply via email to

[Prev in Thread] Current Thread [Next in Thread]