rmlpp

Richard Hasting rich at kunikpok.uucp
Tue Jun 25 23:04:28 AEST 1991


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/<lppname>
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 at kunikpok.uucp; ... !cs.utexas.edu!icus.com!kunikpok!rich
       What organization, I own the machine. 
       "We're on a mission from God." - Dan A.



More information about the Comp.unix.aix mailing list