All I am trying to do is get a count of direcrories on one leve of a tree. so Far I have this.
find /media/data/temp1 -type d -exec basename {} \;
which gives me this:
temp1
Coldplay
Greatest Hits
Sex Pistols
never mind the bollocks here's the sex pistols
the great rock and roll swindle
The Boomtown Rats
CD1
CD2
CD3
CD4
Doris Day
Greatest Hits
To rid me of all of the extra directories that are actually subDirs of the the "base" dir just under temp1 and to get rid of the dirertory that contains the directories I need to get a count of I do this:
find /media/data/temp1 -mindepth 1 -maxdepth 1 -type d -exec basename {} \;
Which gets me this:
Coldplay
Sex Pistols
The Boomtown Rats
Doris Day
The Actual Directories on the level that I need to get a count of all Directories on this very same level. So I can use it to keep track of in a counter such as
let TotalDir--
echo "Dir left to do is "$TotalDir""
So I know there has to be a simple function that I can pipe that into in the syntax such as this to get what I need.
TotalDir=$( echo find /media/data/temp1 -mindepth 1 -maxdepth 1 -type d -exec basename {} \;| "the function name needed here" )
I just do not know what function call to use, or what I'd call them little programs within Linux that most have little knowleage that they are even there and others have loads of knowleadge on how to use them.