#! /bin/bash # @(#) file type check # if [ $# -ne 1 ]; then echo "usage: $0 file" exit 1 fi if [ -f $1 ]; then echo -e "File $1 is" elif [ -d $1 ]; then echo -e "Directory $1 is" else echo -e "????????? $1 is" fi [ -r $1 ] && echo -e "Readable \c" [ -w $1 ] && echo -e "Writable \c" [ -x $1 ] && echo -e "Executable \c" echo "."