I have a variable ${4} which is a path, e.g. /home/user/backup/music/artist/album/, and I would like to parse each folder from this path into individual strings. The number of folders to parse may be different each time, so the code must be able to continue parsing until there's nothing more to parse.
When I have parsed the folder, I want to check if it exists in that position of the folder tree, and if it does not exist I want to create it. E.g. the code has parsed music, and must then check if music exists in /home/user/backup/, and if not, then create it. If this task can be performed within the loop described in the last paragraph, then it is not necessary to keep each folder string.
I hope this is a nice challenge for you, and please ask if you lack any info.