Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2003 16:48:30 +0100
From:      Cliff Sarginson <cls@raggedclown.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: cat
Message-ID:  <20030227154830.GA2770@raggedclown.net>
In-Reply-To: <20030227053526.GB439@dhumketu.homeunix.net>
References:  <20030227053526.GB439@dhumketu.homeunix.net>

next in thread | previous in thread | raw e-mail | index | archive | help
The ultimate answer is that the shell interpets the ">" first,
truncating the output file to 0.
Quickest way to make a file null bytes long (in sh type shells, not
in (t(csh) type):

$ >filename

In bash (also in ksh I think) you can tell the shell not to clobber an existing file,
I think the command is:

$ set noclobber

Or similar..

-- 
Regards
   Cliff

[ This mail has been checked as virus-free ]

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030227154830.GA2770>