Xref: utzoo comp.unix.xenix.sco:1188 comp.unix.shell:1149 Path: utzoo!utgpu!news-server.csri.toronto.edu!dgp.toronto.edu!ckchee Newsgroups: comp.unix.xenix.sco,comp.unix.shell From: ckchee@dgp.toronto.edu (Chuan Chee) Subject: emptying a file and keeping its ownership Message-ID: <1990Dec30.220722.29050@jarvis.csri.toronto.edu> Organization: CSRI, University of Toronto Distribution: na Date: 31 Dec 90 03:07:23 GMT Lines: 19 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 Thanks in advance. ...Chuan Chee ckchee@dgp.utoronto.ca ckchee@dgp.toronto.edu (internet) ckchee@dgp.utoronto (bitnet)