Moshe Moshe - 10 months ago 29
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