我在OSX上使用xargs,并且我发现如果最终字符串很长,-I
字符串替换选项将不起作用。例如:
$ printf "/this/is/a/very/long/path/that/i/created/this/is/a/very/long/path/that/i/created/" | xargs -I % bash -c "echo %; echo %"
/this/is/a/very/long/path/that/i/created/this/is/a/very/long/path/that/i/created/
/this/is/a/very/long/path/that/i/created/this/is/a/very/long/path/that/i/created/
$ printf "/this/is/a/very/long/path/that/i/created/this/is/a/very/long/path/that/i/created/" | xargs -I % bash -c "echo %; echo %; echo %"
/this/is/a/very/long/path/that/i/created/this/is/a/very/long/path/that/i/created/
/this/is/a/very/long/path/that/i/created/this/is/a/very/long/path/that/i/created/
%
这是一个已知的错误吗?有什么(好的)办法解决这个问题?