Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!etive!hwcs!zen!frank From: frank@zen.co.uk (Frank Wales) Newsgroups: comp.unix.questions Subject: Re: Computational complexity of rm & ls Message-ID: <1541@zen.UUCP> Date: 12 Mar 89 18:59:43 GMT References: <9000012@m.cs.uiuc.edu> <4461@pt.cs.cmu.edu> Reply-To: frank@zen.co.uk (Frank Wales) Organization: Zengrange Limited, Leeds, England Lines: 18 In article <4461@pt.cs.cmu.edu> marcoz@MARCOZ.BOLTZ.CS.CMU.EDU (Marco Zagha) writes: >In article <9000012@m.cs.uiuc.edu>, wsmith@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@zen.co.uk<->mcvax!zen.co.uk!frank] Zengrange Ltd., Greenfield Rd., Leeds, ENGLAND, LS9 8DB. (+44) 532 489048 x217