Gnu 병렬 및 파이프

Gnu 병렬 및 파이프

파일의 각 줄을 다른 프로그램의 표준 입력으로 보내고 싶습니다. 예:

입력.txt

line1
line2
line3

나는 이와 같이 gnu 병렬을 사용하고 싶습니다(즉, 각 행을 stdin으로 more 명령에 파이프합니다).

cat input.txt | parallel --pipe more

하지만 돌아온다

/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument
/bin/bash: -c: option requires an argument

내가 원하는 것은 (병렬로 인해 순서가 다를 수도 있음)

line1
line2
line3

누구든지 아이디어를 얻었나요?

답변1

노력하다:

cat input.txt | parallel -N1 --pipe wc

답변2

....로 시도해 보세요.

cat input.txt | xargs -I {} more {}

또는 ... 고양이 input.txt | 더 평행하게

관련 정보