[6754] in RedHat Linux List
Re: Using "find" to get rid of cores etc.
daemon@ATHENA.MIT.EDU (Alan Shutko)
Sat Nov 30 03:58:16 1996
To: redhat-list@redhat.com
From: Alan Shutko <ats@wydo125.wustl.edu>
Date: 30 Nov 1996 02:57:20 -0600
In-Reply-To: Borg's message of Fri, 29 Nov 1996 19:19:35 -0800
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
>>>>> "B" == Borg <vladimip@iceonline.com> writes:
B> Dave Wreski wrote: ........ .....
>> find . -name core -exec rm {} \; -print
B> My "rm" is aliased to "rm -i" in one of my shell startup files. The
B> above command ignores aliasing and unconditionally removes anything
B> matching "-name xxx". Why?
Very good question. Perhaps this snippet of code from pred.c:1359
will be of value:
execvp (execp->vec[0], execp->vec);
What this means is that it is execing the command directly, not
calling a shell to do it (ala system). This means that no aliases
will be honored. So you could do a few things:
* do -ok ....
* do -exec bash -c rm .... (which may pick up aliases depending on
their location in startup files
* write a rm script earlier in the path which does a rm -i (which
will be picked up by _all_ programs, not necessarily desirable)
* bite the bullet and give up on rm -i aliases being horribly
undesirable as espoused by numbers of people. (As opposed to the
numbers of people who like them.)
--
Alan Shutko <ats@hubert.wustl.edu> - The Few, the Proud, the Remaining.
I brake for chezlogs!
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null