🤔
TIL
  • README
  • root
    • Android
      • TextView
      • Intent
      • RecyclerView
      • ImageView
      • Style
      • Activity
      • Databinding
      • EditText
      • RxJava
      • Fragment
    • Code
      • 가장 많은 정보를 가진 객체
    • Shell
      • script
        • 초기 설정
        • 기본 문법
      • chmod
  • Blog
  • Github
Powered by GitBook
On this page
  • 1. 생성
  • 2. 실행 권한 부여
  • 3. #!/bin/bash 추가
  • 4. 실행

Was this helpful?

  1. root
  2. Shell
  3. script

초기 설정

Shell Script 기본 설정

PreviousscriptNext기본 문법

Last updated 5 years ago

Was this helpful?

1. 생성

> touch script.sh

2. 실행 권한 부여

touch 로 생성된 파일의 초기 권한(-rw-r--r--) 은 실행권한이 없으므로 권한 부여

> chmod +x script.sh

3. #!/bin/bash 추가

스크립트 파일 첫번째 line 에 #!/bin/bash 추가

엥? # 은 주석 아니냐? 혹은 추가해야하는 이유가 궁금하면

> vim script.sh

script.sh
#!/bin/bash

4. 실행

./[FILE_NAME]

> ./script.sh
http://forum.falinux.com/zbxe/index.php?document_srl=541629&mid=lecture_tip