I have an input stream containing strings representing file types. I want to print all file types that are not text or are PostScript (PostScript is a text file type). I tried the following sed expression:
sed -n '/PostScript/pb; /text/!p'
However, this returns an error:
sed: -e expression #1, char 14: extra characters after command
This is confusing to me because I thought it was acceptable to specify multiple commands (e.g.
bp) after a pattern.
I can get the behavior I want using the following expression:
sed -n '/PostScript/p; /PostScript/b; /text/!p'
How can I get the behavior I want without duplicating the
/PostScript/ pattern in my expression?