Xref: utzoo comp.unix.xenix.sco:1328 comp.unix.shell:1231 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool2.mu.edu!news.cs.indiana.edu!bronze!speelmo From: speelmo@bronze.ucs.indiana.edu (Lance Speelmon -- UCS) Newsgroups: comp.unix.xenix.sco,comp.unix.shell Subject: Re: emptying a file and keeping its ownership Message-ID: <1991Jan10.182614.20728@bronze.ucs.indiana.edu> Date: 10 Jan 91 18:26:14 GMT References: <1990Dec30.220722.29050@jarvis.csri.toronto.edu> Distribution: na Organization: Indiana University, Bloomington Lines: 24 I think the easiest way to do this is: cp /dev/null Lance In article <1990Dec30.220722.29050@jarvis.csri.toronto.edu> ckchee@dgp.toronto.edu (Chuan Chee) writes: >I have SCO Xenix 2.2.3. What's the easiest way to "empty" a file >while keeping its ownership (owner,group) and access permissions the >same? Actually I only care about permissions (rw-rw-rw). >I would like this done in Bourne shell (or possibly CSH). >One other thing, this shell script is run under root. > >Here's the way I currently do it: > rm -f $FILE > touch $FILE > chmod +w $FILE > chown $OWNER $FILE > chgrp $GRP $FILE > -- ============================================================================== | Lance Speelmon | University Computing Services | | speelmo@bronze.ucs.indiana.edu | Network Operations Center | ==============================================================================