shuf command has an
--output flag that you can use to specify where to write its output (instead of writing to stdout).
I want to shuffle a file in-place. Is it safe to use
shuf file --output file, using the same filename for the output filename and the file to read from?
Or could this cause file corruption? Is it platform-specific? It seems to work OK when I tested on a small file, but the man page doesn't say anything about this, and I'm not sure whether to worry about it.