1
bash 함수 내에서 heredoc을 사용하는 방법은 무엇입니까?
bash 함수 안에 heredoc 을 삽입 할 수 있습니까? 아래의 간단한 샘플로 인해 오류가 발생합니다. ./heredoc_in_function.sh: 10: Syntax error: end of file unexpected (expecting "}") #!/bin/sh my_function () { cat <<HEREDOC heredoc contents HEREDOC } my_function 환경: 우분투 11.04 (GNU / Linux 2.6.38-8- 서버 x86_64) GNU bash, 버전 4.2.8 (1)-릴리스 …