Path: utzoo!mnetor!uunet!husc6!sri-unix!quintus!sun!decwrl!decvax!gsg!lew From: lew@gsg.UUCP (Paul Lew) Newsgroups: comp.unix.wizards Subject: Re: folding arguments Message-ID: <120@gsg.UUCP> Date: 12 Feb 88 03:23:19 GMT References: <3822@megaron.arizona.edu> Reply-To: lew@gsg.UUCP (Paul Lew) Organization: General Systems Group, Salem, NH Lines: 23 > $ command `find $DIR -print` > > which bombs out when I find too many files. I've written a little program > that lets me do > > $ find $DIR -print | fa | while read x; do command $x; done I used the following frequently: $ find $DIR -print | awk '{print "command",$0}' | sh (flexible) or: $ find $DIR -print | sed 's/^/command /' | sh (fast) Both are shorter than the 2nd command and it does not need program 'fa'. It also works from either csh or Bourne shell, i.e., you can do this on all types of Unix. You can also put shell options at end, e.g., sh -x, to echo every command as it executes, or sh -vn to test it first before you delete the wrong files ;-( Anyone has a even shorter solution? -- Paul Lew {oliveb,harvard,decvax}!gsg!lew (UUCP) General Systems Group, 5 Manor Parkway, Salem, NH 03079 (603) 893-1000