Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: find (too many arguments) Message-ID: <1990Jan11.113045.13055@virtech.uucp> Date: 11 Jan 90 11:30:45 GMT References: <22002@adm.BRL.MIL> <388@usdtsg.Dayton.NCR.COM> Organization: Virtual Technologies Inc. Lines: 44 In article <388@usdtsg.Dayton.NCR.COM>, musson@usdtsg.Dayton.NCR.COM (Scott Musson) writes: > > when I do a 'find p* -mtime +1 -print' in a directory with a large number of > files starting with 'p', I get find: too many arguments. The problem is not with find, but with the shell (and OS). There is a maximum number of arguments and/or number of bytes in those arguments. Usually this number is on the order of 5120 bytes. To get around your problem you could do the following: Create the following shell: pgm="$1" shift args="" while [ ! -z "x$1" ] do if [ "x$1" = "xendargs" ]; then shift; break; else args="$args $1" shift fi done $pgm $* $args and call it manysh. now you can do: ls | grep "^p" | xargs | manysh find -mtime +1 -print -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+