creating pipes in find(1)

merlyn at sequent.UUCP merlyn at sequent.UUCP
Sat Sep 29 05:22:10 AEST 1984


#endif BUG

rpw3 at redwood.UUCP sez:
>> WARNING: Make sure that the "find" is not going to give you so much stuff
>> that your shell (or your system) blows up from an over-large argument list.
>> (That is, DON'T do "for i in `find / -print`")

A way around this is to do something like:

	find <dirs> <selection> -print |
	while read i
	do
		<$i commands>
	done

Works real slick.  Example:

	find / -size 0 -print |
	while read i
	do
		ls -ldg $i
	done

does an ls on all zero-length files on the system.

-- A particularly personal and original observation from the thought-stream of
Randal L. ("your favorite phrase here") Schwartz, esq. (merlyn at sequent.UUCP)
	(Former Official Legendary Sorcerer of the 1984 Summer Olympics)
Sequent Computer Systems, Inc. (503)626-5700 (sequent = 1/quosine)
UUCP: {decwrl,ogcvax,pur-ee,rocks34,shell,unisoft,vax135,verdix}!sequent!merlyn



More information about the Comp.unix mailing list