Sponsored Content
Top Forums Shell Programming and Scripting Comparison of 2 sun server patches using script Post 302298625 by Sathvik on Wednesday 18th of March 2009 07:11:14 AM
Old 03-18-2009
Comparison of 2 sun server patches using script

Hi,

I am not sure what I am missing, tried to debug but was not successful, any help on this will be much appreciated.

Code:
#!/bin/sh
rm -f /tmp/t?
host1=`cat $1|grep Hostname: | awk '{print $2}'`
host2=`cat $2|grep Hostname: | awk '{print $2}'`
rel1=`cat $1|grep Release: | awk '{print $2}'`
rel2=`cat $2|grep Release: | awk '{print $2}'`
arch1=`cat $1|grep "Kernel architecture:" | awk '{print $3}'`
arch2=`cat $2|grep "Kernel architecture:" | awk '{print $3}'`

cat $1 |grep "Patch:" | awk '{print $2}'  >/tmp/t1
cat $2 |grep "Patch:" | awk '{print $2}'  >/tmp/t2

cat /tmp/t1 | awk '{print $1}'| sort  >/tmp/t3
cat /tmp/t2 | awk '{print $1}'| sort  >/tmp/t4

prev=`head -1 t3`
for  i in `cat t3`
do
        curr=$i
        if [ $prev != $curr ]
        then
                currhead=`echo $curr | cut -f 1 -d "-"`
                prevhead=`echo $prev | cut -f 1 -d "-"`
                if [ $prevhead != $currhead ]
                then
                        echo $prev >> /tmp/ta
                fi
                prev=$curr
        fi
done

rm /tmp/t?

When I execute this I get the following output, and stucks there itself.

$ ./patchscript
+ rm -f /tmp/t?
+ cat
+ grep Hostname:
+ awk {print $2}

Last edited by DukeNuke2; 03-21-2009 at 01:53 PM..
 

3 More Discussions You Might Find Interesting

1. Solaris

Breaking mirror for patches, sun/os 5.9

Hi, Going to be applying patches to Sun prod (dev 1st) boxes soon, I'm going to break the mirror's on 3 file systems on the root disk prior to that (/, /var, /swap),then run 9_Recommended. Then, run it for a day or 2 before re-syncing the mirrors. But, what if I want to backout of this... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

2. Solaris

Sun Patches question

I have Solaris 9 on my server. From SunSolve site, I see: Solaris9 Sun Alert Patch Cluster (184.9 M) & Solaris9 (204.3 M) What is the difference between the Sun Alert Patch Cluster and the "regular" patch cluster? Thanks! (1 Reply)
Discussion started by: FredSmith
1 Replies

3. AIX

List of Installed patches for AIX from given set of patches

I need to find out list of installed patches from given list of patches. I have tried using instfix -f <File containing list of patches> -i -c But I was not able to understand the output of this command. It was like below. bos.perf.tools: :0.0.0.0:?: bos.rte.libc: :0.0.0.0:?: ... (4 Replies)
Discussion started by: Saurabh Agrawal
4 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 02:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy