Use | xargs echo
:
$ rm $(ls | grep p_ | xargs echo)
Or more directly, | xargs rm
:
$ ls | grep p_ | xargs rm
Or even more directly, since arguments can be separated by any whitespace, which includes newlines:
$ rm $(ls | grep p_)
I personally like globbing:
$ rm p_*