Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!network!ucsd!usc!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: Find doesn't expand {} Message-ID: <1073@virtech.UUCP> Date: 25 Aug 89 12:24:34 GMT References: <12502@well.UUCP> Distribution: all Organization: Virtual Technologies Inc Lines: 23 In article <12502@well.UUCP>, tmh@well.UUCP (Todd M. Hoff) writes: > Why doesn't this work: > > find . -type d -print -exec mkdir /xx/yy/zz/{} \; > > The '{}' doesn't expand out to the filename like you might > expect. Yet this does work: find . -exec ls {} \;. '{} expands > to the filenames and the files are listed. 1. find looks for the {} as an explicit argument, not as a sub-part of another argument. I agree with you in that {} should be substituted even if it is a part of an argument. 2. The find . -exec ls {} \; will list all of the files twice (once when the directory is visited and once as it visits each file. Maybe you would want to use something like "find . -print". -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9240 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+