![xargs 명령 출력이 예측되지 않습니다](https://linux55.com/image/220416/xargs%20%EB%AA%85%EB%A0%B9%20%EC%B6%9C%EB%A0%A5%EC%9D%B4%20%EC%98%88%EC%B8%A1%EB%90%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4.png)
find
내가 이것을 다음과 같이 사용할 때 :
echo 1 2 3 | xargs -I{} find {}
다음과 같은 결과가 나타납니다.
find: ‘1 2 3’: No such file or directory
하지만 다음과 같이 사용할 때 :
echo 1 2 3 | xargs find
나는 다음과 같은 결과를 얻습니다.
find: ‘1’: No such file or directory
find: ‘2’: No such file or directory
find: ‘3’: No such file or directory
{}
사용될 때 단일 문자열로 처리되는 이유는 무엇 입니까(예: 개행 문자만 구분 기호임) -I{}
?
답변1
그것은기록된 기능~의xargs -I
-I replace-str
Replace occurrences of replace-str in the initial-
arguments with names read from standard input. Also,
unquoted blanks do not terminate input items; instead the
separator is the newline character. Implies -x and -L 1