View Single Post
Old Apr 19th, 2005, 3:24 PM   #3
jolok
Newbie
 
jolok's Avatar
 
Join Date: Apr 2005
Location: Antioch, TN
Posts: 3
Rep Power: 0 jolok is on a distinguished road
Send a message via MSN to jolok Send a message via Yahoo to jolok
I should've mentioned that I tried that, first.

if( -e $HOME/*.core ) then
    rm -f $HOME/*.core 2> /dev/null
  else
    echo "No core file"
endif

/home/<user>/*.core: no match

And, from man rm(1):
-f Attempt to remove the files without prompting for confirma-
tion, regardless of the file's permissions. If the file does
not exist, do not display a diagnostic message or modify the
exit status to reflect an error. The -f option overrides any
previous -i options.

So it shouldn't echo stderr anyway, should it?

Also, redirecting both stderr and stdout (which I was trying to do incorrectly in the first example) doesn't help, either:

if( -e $HOME/*.core ) then
    rm -f $HOME/*.core >& /dev/null
  else
    echo "No core files to delete"
endif

the 'else' never gets a chance...

I'll try again without any redirection...
No dice. Same result. Also, from the command line (csh) rm displays the same behavior.
JoloK

Last edited by jolok; Apr 19th, 2005 at 4:00 PM.
jolok is offline   Reply With Quote