Bash 폴더 있는지 확인

Jmnote (토론 | 기여)님의 2018년 3월 11일 (일) 15:24 판 (새 문서: ==개요== ;Bash 폴더 있는지 확인 ;Bash 디렉토리 있는지 확인 <source lang='bash'> filename='/etc' if [ -f $filename ]; then echo "'$filename' exists." else ec...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

Bash 폴더 있는지 확인
Bash 디렉토리 있는지 확인
filename='/etc'
if [ -f $filename ]; then
    echo "'$filename' exists."
else
    echo "'$filename' does not exist."
fi
filename='/etc'
if [ ! -f $filename ]; then
  echo "'$filename' does not exist."
fi

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}