쉘 스크립트에서 shell 스크립트에서 명령으로 stdin을 어떻게 리디렉션합니까?

StackOverflow https://stackoverflow.com/questions/543336

  •  23-08-2019
  •  | 
  •  

문제

쉘 스크립트에서 shell 스크립트에서 명령으로 stdin을 어떻게 리디렉션합니까? Stdin을 Java System.in Stream으로 전달하려고합니다.

교체하고 싶습니다

find . -type f | $JAVA_HOME/bin/java com.domain.BatchProcess

~와 함께

 find . -type f | ./batch.sh
도움이 되었습니까?

해결책

명령 인 경우 :

$JAVA_HOME/bin/java com.domain.BatchProcess

stdin의 입력을 기대 한 다음 스크립트에 넣고 두 번째 명령을 실행하면 작동합니다.

다른 팁

스크립트 내에서 명령을 실행하면 쉘을 대체하고 stdin, stdout 및 stderr를 포함한 파일 설명자입니다.

자동으로 수행합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top