Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!freja.diku.dk!kimcm From: kimcm@diku.dk (Kim Christian Madsen) Newsgroups: comp.unix.shell Subject: Re: Can U pipe filenames to rm??? Message-ID: <1990Sep29.001151.11544@diku.dk> Date: 29 Sep 90 00:11:51 GMT References: <28790001@col.hp.com> Organization: Department Of Computer Science, University Of Copenhagen Lines: 27 greiner@col.hp.com (Mike Greiner) writes: > Piping filenames to the rm command??? > ninstall -h $1 -vvvvv -p $2 | grep path | cut -d " " -f4 >There may be a pretty simple solution to this, but I haven't found it. I'm >considering using a for-loop that parses each line as the loop counter, >but don't know if that's the best approach...appreciate any suggestions! If you're sure the output of the ninstall does not exceed the limit of what the shell you're using can handle (Bourne shell usually 5Kbytes), you can use the following approach: ninstall .... | xargs rm However, if the filelist from ninstall et al. does exceed the shell buffer limit you can do something like (assuming Bourne shell): ninstall | while read filename do rm $filename done Kim Chr. Madsen