emptying a file and keeping its ownership
John F Haugh II
jfh at rpp386.cactus.org
Fri Jan 4 01:19:16 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.
Yes, quite ;-). The C shell has a builtin echo function which does
exactly what Brandon showed. Watch -
--
Script is typescript, started Thu Jan 3 08:17:12 1991
rpp386-> /bin/csh
1 - rpp386-> echo > file
2 - rpp386-> ls -l file
-rw-r----- 1 jfh root 0 Jan 3 08:17 file
3 - rpp386-> exit
4 - rpp386-> rpp386->
Script done Thu Jan 3 08:17:31 1991
--
As you can see "file" has a zero length.
--
John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832 Domain: jfh at rpp386.cactus.org
"While you are here, your wives and girlfriends are dating handsome American
movie and TV stars. Stars like Tom Selleck, Bruce Willis, and Bart Simpson."
More information about the Comp.unix.xenix.sco
mailing list