A for loop that steps through a list of quoted headers:
for h in "header" "header 2"; do echo $h done
header header 2
I'd like to reference the headers somewhere else to clean it up, like assigning them to a variable.
headers='"header" "header 2"' for h in $headers; do echo $h done
but this returns
"header" "header 2"
as it should.
Is there a way to get around this? It's similar to this post with a list of files with spaces, but I'm not doing files, and I'd like to keep them on one line, as there will be many entries.