본문 바로가기

쉘 스크립트

0. vim 초기 설정하기 & Hello world


{홈 디렉토리}/.vimrc 에 다음과 같은 내용 저장


syntax on 
set tabstop=4 
set shiftwidth=4 
set smartindent 
set cindent 



$ cd ~

$ vi helloworld.sh


#!/bin/bash

echo "Hello World"


:wq   ( 저장 후 종료 )


$ chmod +x ./helloworld.sh

$ ./helloworld.sh


다음과 같은 결과를 볼수 있습니다.


helloworld.sh 파일 상단에 적은 #!/bin/bash 문구가 해당 파일은 shell script 파일이다!! 라는 것을 알려주는 겁니다. ㅎㅎ



'쉘 스크립트' 카테고리의 다른 글

[부록] Crontab 의 간단한 사용법  (0) 2017.01.31