Filtering some stdout output using some bash magic