Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- Windows
- IntelliJ
- bash
- xargs
- tomcat
- lsof
- web.xml
- 공통표준용어
- ssh
- context
- Source
- port
- netsh
- Windows 10
- Eclipse
- maVen
- import
- 네트워크
- profile
- find
- 단축키
- grep
- resource
- Quartz
- DB 도메인
- VirtualBox
- GIT
- copy-dependencies
- JavaScript
- Mac
Archives
- Today
- Total
develog
[linux] here document 본문
here document 문법
명령어 << EOF
# 여기에 서브 명령어를 입력
EOF
<< 를 사용하면 블럭 안에 탭이 적용된다
# test.sh
cat << EOF
aa
bb
cc
EOF
실행결과
$ ./test.sh
aa
bb
cc
<<- 를 사용하면 블럭 안에 탭이 무시된다
# test.sh
cat <<- EOF
aa
bb
cc
EOF
실행결과
$ ./test.sh
aa
bb
cc
변수 사용, 명령어 실행
- 변수 사용 : ${}
- 명령어 실행 : $()
# test.sh
message="hello world"
cat <<- EOF
# variable
message=${message}
# command
date=$(date)
EOF
실행결과
$ ./test.sh
# variable
message=hello world
# command
date=Thu 14 Mar 2024 12:28:49 AM UTC
sftp 사용 예제
sftp user01@127.0.0.1 <<- EOF
cd upload
ls
exit
EOF
Comments