![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file comparison script | tiger99 | Shell Programming and Scripting | 1 | 01-30-2008 10:47 AM |
| Problem in ksh script ( String comparison ) | amarnath | AIX | 1 | 07-18-2006 07:40 AM |
| Problem in ksh script ( String comparison ) | amarnath | Shell Programming and Scripting | 3 | 07-13-2006 01:14 PM |
| Help with time comparison shell script for HP-UX | gummysweets | Shell Programming and Scripting | 6 | 10-12-2005 11:48 AM |
| Installing Patches from a script | viRaven | Shell Programming and Scripting | 3 | 12-12-2003 12:52 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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?
$ ./patchscript + rm -f /tmp/t? + cat + grep Hostname: + awk {print $2} Last edited by DukeNuke2; 03-21-2009 at 12:53 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|