Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

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

Posted By: Reginheraht Fischer     Category: Unix / Linux / Ubuntu     Views: 5365

Write a 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.

Code for 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 in Unix / Linux / Ubuntu

if [ $# -eq 0 ]
then
        echo "Comman value not pass"else
        total=`ls -l $1 | wc -l`
        echo "Total entires present in this directory $total"
fi
 
  
Share: 



Reginheraht Fischer
Reginheraht Fischer author of 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 is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!