Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] How do I empty a file without editing it?


* This one time, at band camp, Jobst Schmalenbach said:
> all,
> 
> How do you empty a file without really editing it?
> 
> I remember from a while back its possible and I 
> think you use "ed" and put a ^Z right at the start?
> 
> 
> I want to be able to keep the same file permissions,
> including the owner, so I cant write a script
> delete it and 'touch' it as this opens it with the
> current mask and user.
> 
cat /dev/null > $file

Greeno
-- 
Greeno <tgreen@xxxxxxxxxxxxxx>
GnuPG Key :  1024D/B5657C8B 
Key fingerprint = 9ED8 59CC C161 B857 462E  51E6 7DFB 465B B565 7C8B

Imagine working in a secure environment and finding the string 
_NSAKEY in the OS binaries without a good explanation
    -Alan Cox 04/05/2001