I have this function that returns any directories that contain spaces:
find_dirs ()
{
find "$1" -depth -type d -name '* *' -print
}
With the following a directory structure:
testdir/A B
testdir/A B/C D
testdir/A B/C D/ef
testdir/nospace
The return when running find_dirs() is:
testdir/A B/C D testdir/A B
At this point I am having issues with how to proceed in splitting out this string to just get the 'A B' 'C D' directories to rename. How can I isolate the 2 paths then isolate just the directories within those paths?