Moshe Moshe - 5 months ago 8
Linux Question

Piping result of command as an argument

I want to get the result of

rpm -qa | grep something
and then run the result I got
rpm -ql result-i-got
, and all in one line.

I have found this to work:

rpm -ql $(rpm -qa | grep something)

I wonder, is there any better or even different way of piping this result to get the same result of what I wrote above?


xargs are made for that:

rpm -qa | grep something | xargs rpm -ql