Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!icus!kunikpok!rich From: rich@kunikpok.uucp (Richard Hasting) Newsgroups: comp.unix.aix Subject: rmlpp Keywords: remove lpp usr Message-ID: <19@kunikpok.uucp> Date: 25 Jun 91 13:04:28 GMT Distribution: comp Organization: Kunikpok Kennels & Komputers, Austin, Texas Lines: 58 This weekend, I reloaded my machine and the mksysb tape had all of the LPP's from AIX, much to my chagrin. I decided that I wanted to get back some of that space so I wrote a little rmlpp, of course I had to take my tie off first:-) In any event, it is unsupported by anyone but myself, and it could have done a slightly better job but it got must of it. You might want to remove /usr/lpp/ by hand because this doesn't have that capability and I didn't want to make any undue assumptions. So, if you have a few hidden blemishes and LPP's, use this to clear it right up. #!/bin/ksh # rmlpp: Removes an lpp from your machine. # This is unsupported, but it saved 65 meg on my machine # Written by Richard Hasting # # function usage { echo usage: rmlpp lppname \[lppname ...\] exit } function command_to_exec { LPP=$1 echo $LPP echo remove this LPP? \(\'y\' or \'n\'\) read Y echo $Y if [ $Y != 'y' ] then echo Not deleting $LPP else lslpp -f $LPP | grep -v Option | egrep -v '\-\-\-\-\-\-\-' \ | awk ' {if ( NF == 1 ) print $1; else print $2;}' >/tmp/files rm `cat /tmp/files` rmdir `cat /tmp/files` 2>/dev/null odmdelete -q lpp_name=$LPP -o history odmdelete -q lpp_name=$LPP -o inventory odmdelete -q lpp_name=$LPP -o product odmdelete -q name=$LPP -o lpp fi } for i in $* do command_to_exec $i done -- Richard Hasting, Austin TX. rich@kunikpok.uucp; ... !cs.utexas.edu!icus.com!kunikpok!rich What organization, I own the machine. "We're on a mission from God." - Dan A.