Newsgroups: comp.unix.ultrix Path: utzoo!utgpu!watserv1!watcgl!idallen From: "Ian! D. Allen [CGL]" Subject: Ultrix 4.1 (etc.) find "" -print not what you expect Message-ID: <1991Apr14.195247.15341@watcgl.waterloo.edu> Sender: idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) Organization: Computer Graphics Laboratory, University of Waterloo, Ontario, Canada Date: Sun, 14 Apr 1991 19:52:47 GMT Lines: 27 We all know that Unix treats the null pathname as equivalent to the current directory. Try for example: ls "" Well, don't pass the null pathname to an Ultrix find command -- look what you get: % cd /usr/tmp && find "" -print /VIc34646cef /VIc34k4ofpu /RIc34k4ofpu /msg.idallen [...etc...] Look! Absolute pathnames transplanted onto the root file system! More interesting, sadly, is this example, perhaps run via the cron: cd /usr/tmp && find "" -exec rm -f {} \; Run this as root and trash anything under "/" that has the same name as something under /usr/tmp/. Not nice. Most other "find" commands we've tried have this fault, too. We have source; we fixed ours. -- -IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu [129.97.128.64] Computer Graphics Lab/University of Waterloo/Ontario/Canada