히어닥 HEREDOC

Jmnote (토론 | 기여)님의 2018년 6월 22일 (금) 15:52 판

1 개요

here document, here-document, heredoc, hereis, here-string, here-script
히어 문서, 히어 도큐먼트, 히어 다큐먼트, 히어 문자열, 히어닥
  • 문자열을 쉘스크립트나 프로그래밍 언어 중에 그대로 포함시키기 위한 방법
  • << 뒤에 식별자를 선언하고 원하는 문자열을 쓴 후에 식별자로 끝내면 된다.
  • 지원환경: UNIX 계열 쉘스크립트(sh, csh, ksh, bash, zsh), Perl, PHP, Python, Ruby 등 프로그래밍 언어
[root@zetawiki ~]# cat << EOF > a.txt
> hello
> world
> EOF
[root@zetawiki ~]# cat a.txt
hello
world

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}