- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Comparing Software List
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 06:14 AM
05-28-2005 06:14 AM
I have two servers and on both i have run swlist -l patch > /tmp/patches_servera.txt and then the same command but on server b.
What i want to know is the best way with these two text files, the command to know what patches exist in serverb BUT NOT in servera.
I guess it will be diff but no manipultion using the syntaxes gives me what I need!
Any ideas?
Cheers
Mark
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 07:27 AM
05-28-2005 07:27 AM
Solutionon server a
swlist -l product | grep PH | awk {'print $1'} > /tmp/patch_serverA
on server b
swlist -l product | grep PH | awk {'print $1'} > /tmp/patch_serverB
combine two files into the same place by ftp or your favorite way of file transfer.
then
for patch in `cat patch_serverB`
do
grep -q ${patch) patch_serverA; r=${?}
if [ $r -ne 0 ]
then
echo ${patch} >> /tmp/patches_not_on_serverA
fi
done
when this finishes running, you will have the output you wish in the file /tmp/patches_not_on_serverA
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 08:31 AM
05-28-2005 08:31 AM
Re: Comparing Software List
One small script
Before executing the script make sure you create file file1 which contains patch information of serverB.
# swlist -l patch > file1
ftp file1 to serverA.
Execute following script on serverA
Script::
#!/usr/bin/ksh
list=`swlist -l patch | grep PH| awk '{ print $1 }' | grep -v "#"`
func1()
{
var1=$#
while true
do
if [ $var1 -gt 0 ]
then
result=`cat file1 | grep $1 | wc -l`
if [ $result -eq 0 ]
then
echo " Patch $1 does not exists "
fi
let var1=var1-1
shift 1
else
exit
fi
done
Script Ends::
Now this will tell you what patches those are present on Server are not on ServerB.
Do vice versa also i.e. create file1 for ServerA and execute the script on ServerB.
Picture should be quite clear.
Hope that helps.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 08:34 AM
05-28-2005 08:34 AM
Re: Comparing Software List
Append the script at the end with:
func1 $list
regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 08:36 AM
05-28-2005 08:36 AM
Re: Comparing Software List
Use "comm" command. Check its man pages for options.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 09:01 AM
05-28-2005 09:01 AM
Re: Comparing Software List
for your present scenario...
Type these command sequence in your terminal..
sort /tmp/patches_servera.txt > /tmp/sorted_patches_servera.txt
sort /tmp/patches_serverb.txt > /tmp/sorted_patches_serverb.txt
echo "patches only found in SERVER - A"
comm -23 /tmp/sorted_patches_servera.txt /tmp/sorted_patches_serverb.txt
echo "patches only found in SERVER - B"
comm -13 /tmp/sorted_patches_servera.txt /tmp/sorted_patches_serverb.txt
Regards.
PS: if you want to know the common patches use
comm -12 /tmp/sorted_patches_servera.txt /tmp/sorted_patches_serverb.txt
and if you want all the details is single shot , then use comm file1 file2 ,this will give you three columned output.
1st column : entries unique to file1
2nd column : entries unique to file2
3rd column : entries common in file1 and file2.
Note: need to sort both the files before you feed it to "comm" command.
Cheers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 10:32 AM
05-28-2005 10:32 AM
Re: Comparing Software List
sorry to make my reply into three pieces...
i forgot about one other thing..
before proceeding with the steps put in my previous reply... please make sure the files are created using following command
in SERVER A
swlist -l product | grep PH | awk '{print $1}' > /tmp/patches_servera.txt
in SERVER B
swlist -l product | grep PH | awk '{print $1}' > /tmp/patches_serverb.txt
Sorry Mel Burslan : had to borrow one of your lines...
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2005 04:11 AM
05-29-2005 04:11 AM