2020. 6. 29. 22:51
cat 명령어를 이용해서 print.sh 라는 파일에 여러줄을 입력하는 방법이다.
$ cat <<EOF > print.sh #!/bin/bash echo \$PWD echo $PWD EOF |
# 참고사이트
https://en.wikipedia.org/wiki/Here_document#Unix_shells
https://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash
https://www.cyberciti.biz/faq/using-heredoc-rediection-in-bash-shell-script-to-write-to-file/
'리눅스 > Tip & Tech' 카테고리의 다른 글
jupyter, jupyterlab 설치 (0) | 2020.08.01 |
---|---|
리눅스 한국시간 설정하는 방법 (0) | 2020.07.28 |
json pretty print: JSON을 이쁘게 출력 (0) | 2018.05.16 |
알파인 리눅스(Alpine Linux)란? (1) | 2017.12.21 |