I want to store matches of a find command into a file or variable, but matches should go into separate lines.
When I do files=$(find ./ -type f [match criteria]) then the matches will be separated by one space when I see the echo $files output:
./mounts.sh ./delete-data.sh ./test.sh
How can I store one result per line instead?
find. Note too thatechooutputs each of its arguments with spaces between them, and you're giving it a string for the shell to split up into multiple arguments. – Kusalananda Oct 07 '22 at 14:34echo. – Kusalananda Oct 07 '22 at 14:37