为什么 xargs -i 选项已被弃用?

为什么 xargs -i 选项已被弃用?

我正在读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.

相关内容