Computational complexity of rm & ls

Frank Wales frank at zen.co.uk
Mon Mar 13 04:59:43 AEST 1989


In article <4461 at pt.cs.cmu.edu> marcoz at MARCOZ.BOLTZ.CS.CMU.EDU (Marco Zagha) writes:
>In article <9000012 at m.cs.uiuc.edu>, wsmith at m.cs.uiuc.edu writes:
>> [...]   "rm *" seems to be a common
>> enough idiom that rm could be optimized to handle that case better.
>
>Don't forget that the shell expands the "*", not rm.  All rm sees
>is a huge argv with one name for every file (except .* files).

This was my first thought upon reading what Bill posted, and then I thought:
"maybe he means the act of deleting all the files in a directory is a
common one, and should be handled specially."  Certainly, rm never sees
the '*', only the results of its (sorted, hidden-file-less) expansion.

Maybe adding a '-A' (for All, harder to type than '-a') option to rm would
be justified.  No doubt doing so would break jillions of scripts.  :-)
--
Frank Wales, Systems Manager,        [frank at zen.co.uk<->mcvax!zen.co.uk!frank]
Zengrange Ltd., Greenfield Rd., Leeds, ENGLAND, LS9 8DB. (+44) 532 489048 x217 



More information about the Comp.unix.questions mailing list