Algorithm · Squarepoint · Medium
Use find instead of parsing ls output. The shell loop below is filename-safe because it uses NUL-delimited paths; spaces, tabs, and newlines inside filenames are not treated as separators. find "$target" -type f already includes hidden files, so no extra dotfile flag is needed. -print0 writes a NUL byte after each path. read -r -d '' reads up to that NUL byte instead of a newline, so a filename containing \n is kept as one record. IFS= prevents whitespace stripping, and -r…
Checking your access…