nullifying file content..

Schott, Erik J Mr ANOSC/FCBS erik.schott-FCBS at NETCOM.ARMY.MIL
Thu Dec 16 21:28:07 UTC 2004


Not for csh or tcsh.

% cat .cshrc > somefile
somefile: File exists

% cat .cshrc >| somefile
Missing name for redirect

%cat .cshrc >! somefile
%

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com]On Behalf Of IT Dept
Sent: Thursday, December 16, 2004 2:08 PM
To: 'General Red Hat Linux discussion list'
Subject: RE: nullifying file content..


To bypass the 'noclobber' setting shouldn't it be:

cat /dev/null >| <filename>

Not sure which is right. Don't have that option (noclobber) set so I
don't usually need the command.

Paul Pettit
CCB Inc.

P.s. sorry about that 'rm' recommendation, needed more coffee at the
time.

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com] On Behalf Of Schott, Erik J Mr
ANOSC/FCBS
Sent: Thursday, December 16, 2004 11:31 AM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..


It sounds like you have "noclobber" set.  If you want to temporarily
override it to clear out the file, do this:

cat /dev/null >! <your_file>

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com]On Behalf Of Rigler, Stephen C.
Sent: Thursday, December 16, 2004 9:44 AM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..


cp /dev/null filename

-Steve 

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com]
On Behalf Of Mulley, Nikhil
Sent: Thursday, December 16, 2004 10:23 AM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..

The thing is it is not working under tcsh , while I invoked bash , and
did
the same thing which you have shown , it worked ,
But I did not understand why it did not work under  tcsh  ...
Can any please throw light on this ....

Thanks,
Nikhil

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com]On Behalf Of Karasik, Vitaly
Sent: Thursday, December 16, 2004 5:10 PM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..


well, there is noclobber option which prevent overwriting:
http://unixhelp.ed.ac.uk/environment/env7.html

> -----Original Message-----
> From: redhat-list-bounces at redhat.com
> [mailto:redhat-list-bounces at redhat.com]On Behalf Of Mulley, Nikhil
> Sent: Thu, December 16, 2004 1:30 PM
> To: General Red Hat Linux discussion list
> Subject: RE: nullifying file content..
> 
> 
> I tried it , but was no use 
> $>mylog.log
> mycron.log: File exists
> $
>  :(
> Thanks,
> Nikhil
> 
> -----Original Message-----
> From: redhat-list-bounces at redhat.com
> [mailto:redhat-list-bounces at redhat.com]On Behalf Of Karasik, Vitaly
> Sent: Thursday, December 16, 2004 3:50 PM
> To: General Red Hat Linux discussion list
> Subject: RE: nullifying file content..
> 
> 
> > filename
> 
> > -----Original Message-----
> > From: redhat-list-bounces at redhat.com
> > [mailto:redhat-list-bounces at redhat.com]On Behalf Of Mulley, Nikhil
> > Sent: Thu, December 16, 2004 12:16 PM
> > To: redhat-list at redhat.com
> > Subject: nullifying file content..
> > 
> > 
> >     Hi , I have some 400MB file in my home dir , How do I 
> > remove /clear the file content immediately with in a single 
> > command or should I cat it to /dev/null .
> > Can any body please tell me HOWTO...
> >  °v°
> > /(_)\
> >   ^ ^
> >  
> > -- 
> > redhat-list mailing list
> > unsubscribe mailto:redhat-list-request at redhat.com?subject=subscribe
> > https://www.redhat.com/mailman/listinfo/redhat-list
> > 
> **************************************************************
> *********************
> Information contained in this email message is intended only 
> for use of the individual or entity named above. If the 
> reader of this message is not the intended recipient, or the 
> employee or agent responsible to deliver it to the intended 
> recipient, you are hereby notified that any dissemination, 
> distribution or copying of this communication is strictly 
> prohibited. If you have received this communication in error, 
> please immediately notify the postmaster at nds.com and destroy 
> the original message.
> **************************************************************
> *********************
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
> 
************************************************************************
****
*******
Information contained in this email message is intended only for use of
the
individual or entity named above. If the reader of this message is not
the
intended recipient, or the employee or agent responsible to deliver it
to
the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If
you
have received this communication in error, please immediately notify the
postmaster at nds.com and destroy the original message.
************************************************************************
****
*******

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list