xargs-如果字符串太长,我将无法工作

时间:2019-11-22 11:28:48

标签: xargs

我在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/
%

这是一个已知的错误吗?有什么(好的)办法解决这个问题?

0 个答案:

没有答案