Article View: comp.unix.shell
Article #1277Re: Can U pipe filenames to rm???
From: Kim Christian Madsen
Date: Sat, 29 Sep 1990 00:11
Date: Sat, 29 Sep 1990 00:11
27 lines
1293 bytes
1293 bytes
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
Technical Details
Message-ID:
<1990Sep29.001151.11544@diku.dk>Path:
arc1-ca.pugleaf.net!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!kimcmReferences:
<28790001@col.hp.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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