Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
if test $# = 0
then
echo
echo This script requires 1 argument
exit
fi
declare -i fileCount
declare -i dirCount
declare -i exeCount
fileCount=0
dirCount=0
exeCount=0
for i in $*
do
if test -f $1
then
fileCount=fileCount+1
fi
if test -d $1
then
dirCount=dirCount+1
fi
if test -x $1
then
exeCount=exeCount+1
fi
done
echo Number of Files found=$fileCount
echo Number of Directories found=$dirCount
echo Number of Executable Files found=$exeCount
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.