I accidentally did the same on my Mac via a shell script where I assumed mktemp worked the same as gnu mktemp, it does not. IIRC it was my /Applications directory that was first to be hit; most of the directory was unaffected due to file permissions but it did delete some files despite me catching thee error and sending sigkill within seconds.