I'm trying to create new folders with md files inside, and md files should have some text prepared inside. Problem is when folders have spaces in names. I have tried many different combinations with @, brackets and quotes but nothing worked.
This is current code:
#!/bin/bash
mkdir {folder1,folder2,'another folder'}
for f in $(ls -d -- */); do echo "---
tags: tag1, tag2
---" >> "$f"/mdfile.md; done