I try to write script in shell/bash that will convert yaml directory structure to full paths (for further mkdir -p
it). Yaml is my choice because of human-editability. Structure example is:
- Downloads
- Music
- Movies
- University
- First year
- English
- Maths
- Second year
So I want to replace first-level with current dir (realpath .
), for example, /home/maeda/Downloads
, second with parent dir's full path (for example, /home/maeda/Downloads/Music
)
So I want to achieve this result:
/home/maeda/Downloads
/home/maeda/Downloads/Music
/home/maeda/Downloads/Movies
/home/maeda/University
/home/maeda/University/First year
/home/maeda/University/First year/English
/home/maeda/University/First year/Maths
/home/maeda/University/Second year
How to achieve it?