0
Java에서 Process 또는 ProcessBuilder 오브젝트를 사용하여 아래 bash 쉘 스크립트의 기능을 에뮬레이션하려고합니다. standard-in에 대한 리디렉션을 수행하는 방법이 100 % 명확하지 않습니다. 이것을 어떻게 할 수 있습니까?Java로 Bash 스크립트 이식하기
#
# Redirect shell echo command from standard output to file
# This will construct the input file
#
exec 1> $STDIN
echo -e "$NFILE\n$GFILE\n$INPUT\n$OUTPUT\n$CAX"
exec 1>&-
#
# Run executable redirecting standard in as the input file and output to a log file
#
"$EXE" < $STDIN >& $LOG
왜'exec 1> $ STDIN'입니까? 왜 그냥'echo -e '... "> $ STDIN' – mob
@mobrule 확실하지 않습니다. 나는 그 대본을 물려 받았다. exec 1은 어떻게 다릅니 까? – javacavaj