emptying a file and keeping its ownership

Jay A. Konigsberg jak at sactoh0.SAC.CA.US
Sun Jan 6 05:28:55 AEST 1991


In article <187 at raysnec.UUCP> shwake at raysnec.UUCP (Ray Shwake) writes:
>allbery at NCoast.ORG (Brandon S. Allbery KB8JRR) writes:
>>	% echo > file
>>	% ls -s file
>>	0 file
>
>	Not quite. On the systems I know, echo outputs a new line character.
>Thus your ostensibly zero'ed file would have a size of 1 byte.

Well, I can think of three solutions:

one:
    $ echo "\c" > file

two:
    $ cp /dev/null file  # or /dev/zero

three:
    $ > file

Choose ...

-- 
-------------------------------------------------------------
Jay @ SAC-UNIX, Sacramento, Ca.   UUCP=...pacbell!sactoh0!jak
If something is worth doing, it's worth doing correctly.



More information about the Comp.unix.xenix.sco mailing list