You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've stumbled on this in a real-world example where inside the for loop was some tar and ssh to copy files. Nut sure which process but somebody consumed some of the input leading to strange garbled file names being processed.
A safer solution could be:
while IFS= read -r -d '' file <&3
do
(( count++ ))
done 3< <(find /tmp -print0)
echo "$count"
But of course now if some process reads from 3 for whatever reason it's the same problem. Only a bit less likely.
Maybe you could update the wiki?
The text was updated successfully, but these errors were encountered:
Hi! Sorry if this is not the correct place.
The proposed loop for find has a nasty problem try this:
I've stumbled on this in a real-world example where inside the for loop was some tar and ssh to copy files. Nut sure which process but somebody consumed some of the input leading to strange garbled file names being processed.
A safer solution could be:
But of course now if some process reads from 3 for whatever reason it's the same problem. Only a bit less likely.
Maybe you could update the wiki?
The text was updated successfully, but these errors were encountered: