Re: The safety expansion for FreeBSD rm(1)

From: Martin Cracauer <cracauer_at_cons.org>
Date: Tue, 25 Sep 2007 14:32:48 -0400
My idea of a safety feature for rm(1):

To solve the problem of doing
  rm foo *
instead of
  rm foo*

Look at what the commandline arguments are.  If at least
- one is appearing twice
- or at least one is not appearing at all

, then do a "*" expand like from a shell (not perfect of course not
easy enough) and see whether all elements of "*" are there *plus*
others with no "/".  If so, the above situation occured and you only
go ahead with a special flag.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer_at_cons.org>   http://www.cons.org/cracauer/
FreeBSD - where you want to go, today.      http://www.freebsd.org/
Received on Tue Sep 25 2007 - 16:57:36 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:18 UTC