分页: 1 / 1

[问题]别人用xargs,我也想用,怎么用来着?

发表于 : 2008-11-08 14:19
cnkilior
男人 写了: xargs - build and execute command lines from standard input
男人 写了:The args are read and concatenated together into a single com-
mand. This command is then read and executed by the shell, and
its exit status is returned as the value of eval.
----------
从字面上xargs,和eval没有多大区别,但细看xargs,太复杂了,愣是不会用,还请高手指教。

拜过。

Re: [问题]别人用xargs,我也想用,怎么用来着?

发表于 : 2008-11-08 14:29
xiooli
给个参考吧(清理已删除包的配置文件),高级用法我也不太懂,就简单的这么用了:

代码: 全选

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

Re: [问题]别人用xargs,我也想用,怎么用来着?

发表于 : 2008-11-08 20:25
c\nc
看man吧,xargs和eval怎么会“没多大区别”? xargs是用标准输入(或者文件)来构建命令,比eval复杂多了。

Re: [问题]别人用xargs,我也想用,怎么用来着?

发表于 : 2008-11-09 9:54
cnkilior
xargs的man太复杂了,我也只会echo /|xargs ls