- In the "A" directory:
find . -type f > a.txt
- In the "B" directory:
cat a.txt | while read FILENAMES; do touch "$FILENAMES"; done
Result: Step 2 "creates the files" (I mean only with the same filename, but with 0 Byte size) but if there are subdirs in the "A" directory, then step 2 can't create the files in the subdir, because there are no directories in it.
Question: Is there a way, that "touch" can create directories?
Best Answer
quick shot:
Be aware of special chars (whitespaces, ...) in file-/pathnames and so on ...