Skip to content
  • Levente Polyak's avatar
    fix potential bsdtar stream close error by grep · 0b630e25
    Levente Polyak authored and Eli Schwartz's avatar Eli Schwartz committed
    This silences a useless error message that confuses the user.
    
    bsdtar doesn't like it when the stream gets closed before it finishes
    which may be the case when grep found its match on potentially huge
    archives. Instead of suppressing the whole stderr , we find all matches
    with grep, then use a second pass with `tail` to find only the last
    match, which ensures the stream remains open for bsdtar but we may still
    catch and see useful messages on stderr.
    
    This works because tail has the useful property of not closing early.
    0b630e25