쉘 스크립트
0. vim 초기 설정하기 & Hello world
ggoals
2016. 4. 1. 14:28
{홈 디렉토리}/.vimrc 에 다음과 같은 내용 저장
syntax onset tabstop=4set shiftwidth=4set smartindentset cindent
$ cd ~
$ vi helloworld.sh
#!/bin/bash
echo "Hello World"
:wq ( 저장 후 종료 )
$ chmod +x ./helloworld.sh
$ ./helloworld.sh
다음과 같은 결과를 볼수 있습니다.
helloworld.sh 파일 상단에 적은 #!/bin/bash 문구가 해당 파일은 shell script 파일이다!! 라는 것을 알려주는 겁니다. ㅎㅎ