LinuxShellProgramming UnixShellProgramming

[[[ 의 차이점 : [http]http://mywiki.wooledge.org/BashFAQ/031


Syntax : evaluates filename according to option
test -option filename
or
$ [ -f my_file ]

example : my_file이 존재하고 디렉토리가나 장치가 아닌 일반 파일이면 참(0)을 리턴
$ test -f my_file
$ echo $?
1
$ [ -f my_file ]

options:
-s file         file이 존재하고 크기가 0보다 크면 참
-r file         file이 존재하고 읽을 수 있으면 참
-w file         file이 존재하고 쓸 수 있으면 참
-x file         file이 존재하고 실행할 수 있으면 참
-d directory    디렉토리가 존재하면 참


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2013-06-12 13:06:02
Processing time 0.0130 sec