https://stackoverflow.com/questions/12451278/capture-stdout-to-a-variable-but-still-display-it-in-the-console
# fd 5번이 1번(stdout)과 동일하도록 세팅
exec 5>&1
# echo test.txt 명령의 수행결과를 MY_VAR 변수에 캡처링하면서
# tee 명령을 사용하여 입력된 값을 5번 fd로 출력
MY_VAR=$(echo test.txt | tee >(cat - >&5))