Issue
I have a big file which contains directories paths like below:
$PRJ/fp/t/mxl/lf/
$PRJ/fp/t/mxl/lf/
I want to read this file line by line and list out all the files inside each directory file in a line in output file.
I can use find command with directory path directory specify but how to use it with a file having directory paths is something I want.
find input_file -type f
does not work.
Solution
while IFS= read -r dir; do
find "$dir" -type f
done < <(envsubst < my_big_file)
See https://unix.stackexchange.com/a/294400/133219 and the man page for more info on envsubst
.
Answered By - Ed Morton Answer Checked By - Mary Flores (WPSolving Volunteer)