#!/bin/bash

directory ()
{
 let "filenum=0"
 let "dirnum=0"
 echo "Input your directory"
 read "dirnums"
 for file in $(ls $dirnums)
 do
   if [ -d "$dirnums/$file" ]
     then
        let dirnum=dirnum+1
     else
        let filenum=filenum+1
   fi
 done
 echo "The number of directories is $dirnum"
 echo "The number of files is $filenum"
}
directory