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





Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C