Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F Haugh II) Newsgroups: comp.unix.xenix.sco Subject: Re: emptying a file and keeping its ownership Message-ID: <18876@rpp386.cactus.org> Date: 3 Jan 91 14:19:16 GMT References: <1990Dec30.220722.29050@jarvis.csri.toronto.edu> <1990Dec31.214030.7816@athena.mit.edu> <1991Jan1.040621.27634@NCoast.ORG> <187@raysnec.UUCP> Reply-To: jfh@rpp386.cactus.org (John F Haugh II) Distribution: na Organization: Lone Star Cafe and BBS Service Lines: 27 X-Clever-Slogan: Recycle or Die. In article <187@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes: >allbery@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@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."