命令的管道结果作为参数 [英] Piping result of command as an argument
本文介绍了命令的管道结果作为参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获得rpm -qa | grep something
的结果,然后运行得到rpm -ql result-i-got
的结果,并且全部一行.
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.
我发现这可行:
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? Thanks.
推荐答案
xargs
为此:
rpm -qa | grep something | xargs rpm -ql
这篇关于命令的管道结果作为参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文