免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2038 | 回复: 7
打印 上一主题 下一主题

请问一个xargs 的 -i 参数 "废弃的标志"是什么意思? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-11 13:01 |只看该作者 |倒序浏览
请问一个xargs 的 -i 参数 "废弃的标志"是什么意思?
不理解什么意思?man xargs也看不明白

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
2 [报告]
发表于 2008-07-11 13:07 |只看该作者

回复 #1 luoweihao 的帖子

就是叫你最好不用,在新版本中可能没有该选项,或者是与某种标准不兼容。

论坛徽章:
0
3 [报告]
发表于 2008-07-11 13:08 |只看该作者
原帖由 luoweihao 于 2008-7-11 13:01 发表
请问一个xargs 的 -i 参数 "废弃的标志"是什么意思?
不理解什么意思?man xargs也看不明白



       The -l and -i options appear in the 1997 version of the POSIX standard,
       but  do  not appear in the 2004 version of the standard.  Therefore you
       should use -L and -I instead, respectively.

论坛徽章:
0
4 [报告]
发表于 2008-07-12 23:10 |只看该作者
所谓废弃是指虽然现在能够使用,但并不鼓励你这样做(出于安全,效率等等一些因素),它会最终消失。而你需要使用它的替换。。。

论坛徽章:
0
5 [报告]
发表于 2008-07-12 23:14 |只看该作者

回复 #4 sdu_lizhipeng 的帖子

The -l and -i options appear in the 1997 version of the POSIX standard,
       but  do  not appear in the 2004 version of the standard.  Therefore you
       should use -L and -I instead, respectively.

已经指出2004的版本中就消失了,要使用的话用-L 和-I代替.

论坛徽章:
0
6 [报告]
发表于 2008-07-13 10:25 |只看该作者
呵呵,我知道在2004中没有出现,但现在-i选项在我的BASH中确实能用。。。。所以我用了“不鼓励,最终会消失”这样的描述。。。如果说现在已经消失,那将是不准确的描述。。。
Usage: xargs [-0prtx] [--interactive] [--null] [-d|--delimiter=delim]
       [-E eof-str] [-e[eof-str]]  [--eof[=eof-str]]
       [-L max-lines] [-l[max-lines]] [--max-lines[=max-lines]]
       [-I replace-str] [-i[replace-str]] [--replace[=replace-str]]
       [-n max-args] [--max-args=max-args]
       [-s max-chars] [--max-chars=max-chars]
       [-P max-procs]  [--max-procs=max-procs] [--show-limits]
       [--verbose] [--exit] [--no-run-if-empty] [--arg-file=file]
       [--version] [--help] [command [initial-arguments]]


tux@tux-desktop:~/test$ echo l | xargs -ia  ls -a
total 8
-rwxr--r-- 1 tux tux 54 2008-07-11 12:14 test
-rwxr--r-- 1 tux tux 54 2008-07-12 00:13 test.r

论坛徽章:
0
7 [报告]
发表于 2008-07-13 10:40 |只看该作者
原帖由 sdu_lizhipeng 于 2008-7-13 10:25 发表
呵呵,我知道在2004中没有出现,但现在-i选项在我的BASH中确实能用。。。。所以我用了“不鼓励,最终会消失”这样的描述。。。如果说现在已经消失,那将是不准确的描述。。。
Usage: xargs [-0prtx] [--intera ...

这个和bash没有关系的吧,应该和xargs的版本有关,以下版本中都可以使用:
4.1.20
4.2.22
4.2.27
4.2.28
4.3.13

论坛徽章:
0
8 [报告]
发表于 2008-07-13 10:53 |只看该作者

回复 #7 walkerxk 的帖子

哦,我这是GNU xargs version 4.2.32
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP