mcuddy@rutabaga.Rational.COM (Mike Cuddy) (04/03/91)
Here are two scripts that I use on our systems here: the first one, lpphist, summarizes the output of lslpp listing only the last entry for a given lpp (presumably the most useful.. ;-). the second script mkmotd a perl script outputs a simple line using information from lslpp and lpphist (it assumes that lpphist is in your path): AIX 1.3 on oztotl (1763000) (bos.obj: 03.01.0002.0015 on 03/18/91 by root) I put this in /etc/motd -- mostly because I like sun's little banner that they put there ;-) If anybody finds these useful, great, if not, oh well ;-) --Mike Cuddy "...He's a UNIX hack and he's okay, he works all night and he sleeps all day..." Well, where I come from, we have a saying: "If you're not going to grab the bull by the horns while the iron is in the fire, then get off the pot." (There are a lot of chemicals in the water where I come from.) -- Dave Barry ---- cut ---- cut --- ---- cut ---- cut --- ---- cut ---- cut --- #!/bin/sh # This is a shell archive. # Run the following text with /bin/sh to extract. sed -e 's/^X//' << \EOFMARK > mkmotd X#!/usr/local/bin/perl X# X# mkmotd - gather a bit of information for /etc/motd. X# X$uname = `uname -a`; chop $uname; # get uname info and clobber newline X$hist = `lpphist bos.obj`; chop $hist; X($foo, $foo, $foo, $date, $level, $who) = split(" ",$hist); X($os, $node, $major, $minor, $hostid) = split(" ",$uname); X$hostid =~ s/^0*//; Xprint X "$os $major.$minor on $node ($hostid) (bos.obj: $level on $date by $who)\n"; EOFMARK sed -e 's/^X//' << \EOFMARK > lpphist X#!/bin/csh -f X# lpp history summary. finds the latest history for the installed lpp's X# uses lslpp -c -h -q for input. X# X# usage: lpphist [ lppnames ] X# Xlslpp -c -h -q $argv | awk -F: '\ X { if ($1 != "") { \ X if (lpp != "") { \ X printf("%-20s %-10s %-10s %-9s %15s %s\n",\ X lpp, state, event, date, release, user); \ X } \ X lpp = $1; \ X } \ X state = $2; event = $3; date = $4; \ X release = $5; user = $6; \ X }\ X END {\ X printf("%-20s %-10s %-10s %-9s %15s %s\n",\ X lpp, state, event, date, release, user); \ X } ' EOFMARK