Re: [PATCH v4 1/5] t9300: factor out portable "head -c" replacement
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 1, 2016, 04:45 UTC
- Message-ID
- <CAPig+cS334=jN54Ab46VoNoD7uzEgLXwaNE1ePZwqgZYja33cw@mail.gmail.com>
- In-Reply-To
- <20160630090753.GA17463@sigill.intra.peff.net>
On Thursday, June 30, 2016, Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
> In shell scripts it is sometimes useful to be able to read > exactly N bytes from a pipe. Doing this portably turns out > to be surprisingly difficult. > > We want a solution that: > > - is portable > > - never reads more than N bytes due to buffering (which > would mean those bytes are not available to the next > program to read from the same pipe) > > - handles partial reads by looping until N bytes or read
s/or/are/
> (or we see EOF)