How to make sed omit not matching lines?
Use the no-print
flag (-n
) and explicitly print successful substitute commands (s///p
):
sed -n 's/\(a\|c\)./\1/p'
Use the no-print
flag (-n
) and explicitly print successful substitute commands (s///p
):
sed -n 's/\(a\|c\)./\1/p'