IT

0136. 파일비교하기 Bourn 쉘 작성

띠앗머리 2015. 7. 8. 17:21

#!/bin/sh

FILE="/srcarea3/tf/oany/t/test"

echo $FILE

 

if [ -d $FILE ]

then

 echo "$FILE is directory"

elif [ -f $FILE ]

then

 echo "$FILE is file---"

 if [ -w $FILE ]

 then

  echo "$FILE write,read only"

 elif [ -w $FILE ]

 then

  echo "$FILE write only"

 elif [ -x $FILE ]

 then

  echo "$FILE execute only"

 fi

else

 echo "$FILE is none"

fi