Can U pipe filenames to rm???

Mike Greiner greiner at col.hp.com
Fri Sep 28 05:13:46 AEST 1990


                    Piping filenames to the rm command???

I am trying to write a script to uninstall files installed via an
ninstall package.  I can generate a list of filenames to delete, but
I haven't figured out how to pipe this list of names to rm.  Here's
the heart of my script so far, followed by its output:

    ninstall -h $1 -vvvvv -p $2 | grep path | cut -d " " -f4

Now I want to pipe the output of this command into rm.  Here's the output:

     /usr/local/doc/ninstall/UserGuide.mm
     /usr/local/man/man1/ninstall.1
     /usr/local/man/man1m/installd.1m

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!

--Mike

#############################
# Mike Greiner              #
# Information Technology    #
# Hewlett-Packard           #
# Colorado Springs Division #
# greiner at col.hp.com        #
#############################



More information about the Comp.unix.shell mailing list