我正在读Linux 手册页xargs
最近,该选项似乎-i
已被弃用。引用文档:
-i[replace-str], --replace[=replace-str]
This option is a synonym for -Ireplace-str if replace-str is
specified. If the replace-str argument is missing, the effect
is the same as -I{}. This option is deprecated; use -I
instead.
只是好奇,为什么它被弃用了?使用更详细的语法的原因是什么-I{}
?
答案1
穆鲁是对的,如果你检查findutil
变更日志@1645行
- 版本 4.2.9 中的主要更改,2004-12-05
xargs
现在支持 POSIX 选项-E
和-I
.-L
这些是现有选项-e
、-i
和的同义词-l
,但后三个选项现已弃用。
页面上也有解释man
,请参阅-l
选项:
The -l option is deprecated since the POSIX standard specifies -L instead.
并进一步向下:
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.