emptying a file and keeping its ownership

Jay A. Snyder jay at gdx.UUCP
Sat Jan 5 15:26:58 AEST 1991


>
>I find that in my csh, the following works:
>	% : > file
>That initial colon does the trick. What mechanism is operating here?
>

The ':' is a comment character for old versions of sh (dating from
V7), in fact V7 bourne shell doesn't accept '#' for comments.  Most
modern verions of sh do recongnize the ':'.

If you are running Xenix, the ':' is also used to tell a non bourne
shell that a script is intended for bourne shell (equiv to a BSD file
with #!/bin/sh as the first line).

J



More information about the Comp.unix.xenix.sco mailing list