I don't understand this article. Saying "Replacing the contents of a file on the UNIX command line using the standard cp/mv commands is surprisingly tricky" is like saying "driving a car using only your ass is surprisingly tricky". That's true, but when there are standard, simple, non-tricky ways to do it then you're really just limiting yourself.<p>But hey, I'll play along. Won't this work:
cp file /dev/stdout > file