본문 바로가기

IT/unix shell

추가적인 korn shell 정의

반응형

원문 : http://b62.tripod.com/doc/docksh.htm



korn shell 내부에서 if 를 이용한 파일 타입 체크!

Test Objects (Files, Directories, etc.)

test "true" if:                 ksh
-----------------------------------
object exist                    -a
readable                        -r
writable                        -w
executable                      -x
non-zero length                 -s
zero length


directory                       -d
plain file                      -f
symbolic link                   -h
named pipe                      -p
block special file              -b
character special file          -c
soft link                       -L
socket                          -S

owned by me                     -O
owned by my group              not

"sticky" bit set                -k
set-group-ID bit set            -g
set-user-id bit set             -u

opened on a terminal           not

반응형