Subject: Using -o with -v

From: Arseny Sher <[email-masked]>
Date: Tue, 01 Aug 2017 12:19:12 +0300

Hi,

Is it possible to output symbols which constitute non-matched
parts of text? For example, I expect

printf "banana\napple" | grep --invert-match --only-matching 'ban'

to produce

ana
apple

or

apple

, but it doesn't produce anything.

I need -o because I grep multiline pattern with -z.

--
Arseny Sher