Path: utzoo!attcan!ncrcan!scocan!troch!john From: john@sco.COM (John R. MacMillan) Newsgroups: comp.unix.shell Subject: Re: Beware xargs security holes Message-ID: Date: 29 Oct 90 00:04:35 GMT References: <1890@necisa.ho.necisa.oz> <1990Oct24.0100 <649@inews.intel.com> Sender: news@sco.com (News administration) Organization: SCO Canada, Inc. (formerly HCR Corporation) Lines: 21 |> |>find / -name '#*' -print | xargs patok '.*/#[^/]*' rm -f -- |> |>where patok elimnates arguments that don't match the pattern. |>[patok] shouldn't be too hard to write. | |find / -name '#*' -print | egrep -v '.*/#[^/]*' | xargs rm -f -- Of course by the time I'd realized this, Blair had already pointed it out. It's so much more painless when you catch your own mistakes. Speaking of which, you probably don't want the -v to egrep unless you want to remove only the files the nasty guy wanted you to, and the pattern should probably have been '/#[^/]*$'. So now that we can all safely and automatically remove files I think we should kill this thread before I embarass myself further. -- John R. MacMillan | I'm in love with a McDonald's girl SCO Canada, Inc. | She's an angel in a polyester uniform. john@sco.COM | -- barenaked ladies