Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: folding arguments Message-ID: <7237@ncoast.UUCP> Date: 18 Feb 88 00:27:58 GMT References: <3822@megaron.arizona.edu> <120@gsg.UUCP> <2091@bsu-cs.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 31 As quoted from <2091@bsu-cs.UUCP> by dhesi@bsu-cs.UUCP (Rahul Dhesi): +--------------- | In article <120@gsg.UUCP> lew@gsg.UUCP (Paul Lew) writes: | > $ find $DIR -print | awk '{print "command",$0}' | sh (flexible) | >or: | > $ find $DIR -print | sed 's/^/command /' | sh (fast) | | Me, I prefer: | | $ find $DIR -exec command {} \; +--------------- Hmmm... $ find $DIR -print | xargs command +--------------- | in that case. In a pinch I would try something like this: | | $ find $DIR -print | nroff | sed -e 's/ */ /g' | ... | | Since nroff right-justifies by default, we use sed to squeeze multiple | blanks to a single blank so "while read" in sh will work. (Not | tested.) +--------------- The shell (sh, at least) isn't fazed by multiple spaces... at least, not the AT&T version. But if you're after efficiency, nroff is the LAST thing you should use! ;-) -- Brandon S. Allbery, moderator of comp.sources.misc {well!hoptoad,uunet!hnsurg3,cbosgd,sun!mandrill}!ncoast!allbery KABOOM!!! Worf: "I think I'm sick." LaForge: "I'm sure half the ship knows it."