Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.unix.wizards Subject: Re: Look! An xargs!! (Re: recursive grep) Message-ID: <1126@virtech.UUCP> Date: 4 Sep 89 01:54:53 GMT References: <666@lakart.UUCP> <1641@cbnewsl.ATT.COM> <7774@cbmvax.UUCP> <16816@pasteur.Berkeley.EDU> Organization: Virtual Technologies Inc Lines: 25 In article <16816@pasteur.Berkeley.EDU>, deboor@buddy.Berkeley.EDU (Adam R de Boor) writes: > > Shell scripts 201 (Graduate level :) > > #!/bin/sh - > args="" > while read arg; do > args="$args $arg" > done > $* $args Yet another non-solution. This one does not handle the problem where the list of arguments exceeds the maximum length (usually 5120 bytes). Also there is a dependency that the args variable in the while loop is available outside the loop. I have found that this is not always true due to the fact that the while loop may be implemented using a sub-shell. I guess we need a post-graduate level course, or a beginners c program class. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+