문법/쉘스크립트2015. 8. 3. 14:14


[~]# vi test.sh


#!/bin/sh

#

#

## 변수 선언

##

FILE1=/usr/local/file.tar


## 디렉토리명 파일 직적 선택

##

if [ -f /usr/loca/file.tar ]; then

echo "file.tar exists!"

else 

echo "file.tar not exists!"

fi


## 변수 이용

##

if [ -f $FILE1 ]; then

echo "$FILE1 exists!"

else 

echo "$FILE1 not exists!"

fi



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

Shell script /r 표현 제거  (0) 2015.07.29
Posted by idwook