Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!star.cs.vu.nl!engbert From: engbert@cs.vu.nl (=Engbert Gerrit IJff) Newsgroups: comp.unix.shell Subject: Re: Beware xargs security holes Message-ID: <8093@star.cs.vu.nl> Date: 30 Oct 90 14:22:23 GMT References: <1990Oct24.0100 <649@inews.intel.com> <653@inews.intel.com> <303@cadlab.sublink.ORG> Sender: news@cs.vu.nl Reply-To: engbert@cs.vu.nl (=Engbert Gerrit IJff) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 16 In article <303@cadlab.sublink.ORG>, staff@cadlab.sublink.ORG (Alex Martelli) writes: ) bhoughto@cmdnfs.intel.com (Blair P. Houghton) writes: ) ... ) >>find / -name '#*' -print | egrep -v '.*/#[^/]*' | xargs rm -f -- ) >Lose the -v, dimwit. ) ) Won't "egrep '/#'" pass EXACTLY the same lines as "egrep '.*/#[^/]*'"??? ) After all, it's not as if the RE had to match ALL of the incoming line! ) Yours for simpler, more regular expression of Regular Expressions... Yes, you're right. However, if I am right, the original intention was to delete files whose names started with the # character. Shouldn't it be "egrep '/#[^/]*$'" then, to check on the basename? ^ Bert IJff