Write a shell script to count and report the number of entries present in each subdirectory mentioned in the path, which is supplied as a command-line argument.
Answers
Answered by
1
The basis script for counting and reporting the number of entries in each subdirectory is mentioned in the math. if [ $# -eq 0 ];
then; echo "Enter path : "; read path; else path=$1; fi for dir in `ls -R $path` doif [ -e $dir ] then vcount=`expr $vcount+1` echo $dir fi done echo "There is $vcount file"
Similar questions
Math,
7 months ago
Physics,
7 months ago
Science,
7 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
Hindi,
1 year ago