#!/bin/bash FILE_NAME='ls Dockerfile' if [ $FILE_NAME = "Dockerfile" ] then echo $FILE_NAME else echo "This is not found Dockerfile" fi |
위 Bash shell script는 스크립트가 실행되는 디렉토리에서 Dockerfile의 유무를 확인하는 Bash shell script이다.
조건문에 기재된 echo를 특정 명령어로 치환하여서 사용할 수 있다.
'프로그래밍 [Programming] > Bash shell script' 카테고리의 다른 글
Flask auto run and install shell script for EC2 Instance on Amazon Linux 2 (0) | 2021.09.25 |
---|