SC2267
Joachim Ansorg edited this page Nov 12, 2021
·
3 revisions
GNU xargs -i is deprecated in favor of -I{}
Problematic code:
# Implicit replacement string
xargs -i ls {}
# Explicit replacement string
xargs -imyfilename ls myfilenameCorrect code:
xargs -I {} ls {}
xargs -I filename ls filenameRationale:
xargs -i is a GNU specific option. It has been deprecated in favor of the POSIX standard option -I.
Note that -i will implicitly use {} as a token if nothing is specified, while -I requires it to be explicit.
Exceptions:
None.
Related resources:
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!