Resource Test [Shell Program]



echo "Enter the
Resource name"


read fname


if ( test -s $fname )


then


ls -l $fname


if ( test -d $fname )


then


echo "It is a
directory"


else


echo "It is a
file"


fi


if ( test -r $fname )


then


echo "It is a
readable"


fi


if ( test -w $fname )


then


echo "It is
writable"


fi


if ( test -x $fname )


then


echo "It is
executable"


fi


else


echo "No such
resource present"


fi





0 Comments