Programming/Shell-script
쉘 스크립트 파일 작성하기 - #!으로 시작 + 공백없이 + 바이너리명
woonizzooni
2020. 11. 22. 23:38
쉬뱅/샤뱅/(She(#)bang(!) : #!) 라인으로 시작해서,
내용 작성/저장 > 실행권한 주고 실행.
아래는 sh 스크립트 예.
$ vim hello.sh #!/bin/shecho "hello world"
$ chmod 755 ./hello.sh $ ./hello.sh "hello world" |
응용)
#!/bin/sh
#!/usr/bin/python3
#!/usr/bin/perl
...
[참고]
wiki.kldp.org/HOWTO/html/Adv-Bash-Scr-HOWTO/sha-bang.html