I want sed to split lines and then process those lines.
E.g. sed 's/,/\n/g' | sed -n '/foo/p'
Can that be done in one sed command in general so that I do not need shell piping?
Example:
echo oof,foo | sed 's/,/\n/g' | sed -n '/foo/p'
Outputs (in Ubuntu):
foo
But if I just
echo oof,foo | sed -n 's/,/\n/g;/foo/p'
it prints
oof
foo
which is not what I expect.
 
                