Safely Handling Filenames with Newlines Using find and while read
0
votes
2
answers
91
views
I want to handle filenames with newlines in a bash script rather than having
find "$search_dir" -type f | while IFS= read -r file; do
Perhaps something like the following would do it
find "$search_dir" -type f -print0 | while read -d '' -r file; do
Would I also need to include
IFS=
?
Asked by Filangieri
(179 rep)
Jun 8, 2025, 10:26 PM
Last activity: Jun 9, 2025, 03:21 PM
Last activity: Jun 9, 2025, 03:21 PM