What is the best way to create a new, empty file that has the same ownership and perms as an existing file for a Solaris /bin/sh shell script?
This is for rotating a log file away for compression and dump storage.
At the moment I am using:
mv log log_ts && cp -p log_ts log && cp /dev/null log
Is there a better way to do it?
Update: Unfortunately this is on a conservatively built live Sol10 server and no gnu fileutils are available.