#!/bin/bash
# This is program will check you file name,which sys has or not,end print types.
#2019/07/19 FSQ
First release
echo -e "input file name:" filename
read filename
test -z $filename && echo "please input a file name" && exit 0
test ! -e $filename && echo" $filename is not exsit" && exit 0
test -d $filename && filetype="regulare file"
test -f $filename && filetype="directory"
test -r $filename && perm="readable"
test -w $filename && perm="$perm writeable"
test -x $filename && perm="$perm
echo "The file name : $filename is a $filetype"
echo "And the permissions are :$perm"
原文:https://www.cnblogs.com/fsq-mysql/p/11211842.html