I have this script:
while read $item;
do
# Some bash logic here
done <<< "$({ cat /path/to/some/file; echo; })"
Now I want to also use find to find the name of some directories, and pass that alongside the cat to the while loop.
In other words, I want to:
cata filefindsome directories- Concatenate the results
- Feed them as here-document to the
whileloop
I'm stuck at this point.
I though of duplicating the while logic, which is not a good method. I also thought of reusing the logic inside the while loop using functions.
However, concatenating stuff in here-document might seem to be the correct way to do it.