다음과 같이 명령 출력 (터미널에 표시되는 명령)을 로그 파일에 출력하는 bash가 있다고 가정 해 봅시다.
#!/bin/bash
exec 3>&1
exec 1> logfile.log # logfile.log contains all what will be printed in terminal and it will keep updating its content till the script finish it is job
command#1
command#2
command#3
.
.
.
.
.
echo -n "Process is DONE ..."
exec 1>&3
exec 3>&-
이 스크립트를 완료하는 데 몇 분이 걸리면 스크립트에 포함 된 명령을 하나씩 실행하여 작동합니다.
이 스크립트는 "logfile.log"파일 내에서 "Process is DONE"이라는 문장을 찾을 때까지 1 초마다 점을 인쇄하는 방법은 무엇입니까? 살아 있는?
@ don_crissti보다 유용하게 만들기 위해 질문을 수정했습니다.