Xref: utzoo comp.unix.xenix.sco:1213 comp.unix.shell:1156 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.unix.xenix.sco,comp.unix.shell Subject: Re: emptying a file and keeping its ownership Message-ID: <1991Jan1.040621.27634@NCoast.ORG> Date: 1 Jan 91 04:06:21 GMT References: <1990Dec30.220722.29050@jarvis.csri.toronto.edu> <1990Dec31.214030.7816@athena.mit.edu> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.unix.xenix.sco Distribution: na Organization: North Coast Computer Resources (ncoast) Lines: 25 As quoted from <1990Dec31.214030.7816@athena.mit.edu> by jik@athena.mit.edu (Jonathan I. Kamens): +--------------- | Several people have suggested using | > $FILE | to truncate a file while retaining its old permissions. This will work under | sh or ksh or bash or other shells that allow null commands for redirection. | Unfortunately, csh and tcsh do not allow such null commands :-(. Therefore, +--------------- % ls -s file 4 file % echo > file % ls -s file 0 file % _ Not that I like csh's echo behavior in this case, but it does get around the "null command" problem. ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY