I have a database where each product has a directory, beneath that are the various versions. e.g.
product1
product1/a.b.c
product1/a.b.d
product2
product3
product3/n.m.o
product4 etc.
Some products have no versions.
I want to list all products that have versions available, so ls -1d mydatabase/*/*.*.* works but gives me all matches. I want to reduce this list to show just the containing folders;
e.g.
product1 product3 etc.
ls -1 mydatabase/*/*.*.*/.. doesnt work.
Any ideas?