I have a bash script:
for j in "$(ls -d */)"; do echo "$j" echo "$j" done
and this outputs:
dir1/ dir2/ dir3/ dir1/ dir2/ dir3/
What I want it to output is this:
dir1/ dir1/ dir2/ dir2/ dir3/ dir3/
How do I get it to output this way?
(This is a toy example, what I really want it to do is cd into the directory, do some stuff, and cd back out, which I realize I can probably do the equivalent with some string concatenation but this behavior is so baffling to me and I couldn't find any other questions on it so I thought I would ask.)