help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Annihilating data


From: Quentin L'Hours
Subject: Re: [Help-bash] Annihilating data
Date: Fri, 2 Nov 2018 13:38:48 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 2018-11-02 11:56 AM, Paul-Jürgen Wagner wrote:
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?

I would have done this as you described (cat + sleep + kill), though I think this isn't the best solution either:

analyze() {
  cat <&0 > /dev/null &
  sleep "$end"
  kill "$!"
  <process the rest>
}

--
Quentin



reply via email to

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