SHELL SCRIPT TO GET NO OF SUBDIRECTORY IN CURRENT DIRECTORY | URDINESH

Software Programming, Tutorials, Interview Preparations,Stock Market,BSE/NSE, General informations

Tuesday, July 21, 2015

SHELL SCRIPT TO GET NO OF SUBDIRECTORY IN CURRENT DIRECTORY

ALL SUBDIRECTORY IN CURRENT DIRECTORY:

echo "to display all sub directory"
for i in *
do
if [ -d $i ]
then
echo $i "is an directory"
fi
done





OUTPUT:

[@localhost ~]$ sh subdirt.sh
to display all sub directory
123 is an directory

324@86 is an directory

No comments:

Post a Comment

Thanks for your valuable comments

Followers