- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: comparing columns in the text file
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
07-14-2009 02:04 PM
07-14-2009 02:04 PM
comparing columns in the text file
here is the output of the script
server1 10/20/2006 10/19/2011 permanent number of cpus: 16
server2 04/01/2009 04/30/2009 temporary number of cpus: 16
server3 03/30/2006 03/29/2011 permanent number of cpus: 16
server4 05/31/2008 05/30/2013 permanent number of cpus: 56
server5 04/01/2009 04/30/2009 temporary number of cpus: 32
server6 04/01/2009 04/30/2009 temporary number of cpus: 32
server7 03/30/2006 03/29/2011 permanent number of cpus: 48
server8 08/30/2006 08/29/2011 permanent number of cpus: 64
server9 10/31/1999 10/30/2012 permanent number of cpus: 16
server10 08/31/2006 08/30/2011 permanent number of cpus: 40
I am trying to find a way to compare that original data with the output script produce everytime it runs using script so that i wont spend my some hours daily doing that but I coulnt figure out how to do it.
Could you guys help me how can I do this please
Any help will be appreciated
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 02:11 PM
07-14-2009 02:11 PM
Re: comparing columns in the text file
and if something is changed should email the changes to the group so that they know what things are changed.
for example number of cpus changed on the server1 it should send alter to pidit@gmail.com saying number of cpus (or the field changed) change is server 1
:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 03:01 PM
07-14-2009 03:01 PM
Re: comparing columns in the text file
YOu could do something like this:
#!/usr/bin/sh
typeset MYBASE=/var/tmp/mybase
typeset NEWBASE=/var/tmp/newbase
typeset MYDIFF=/var/tmp/mydiff
diff ${MYBASE} ${NEWBASE} > ${MYDIFF}
[ -s "${MYDIFF}" && mailx root -s "Files differ!" < ${MYDIFF}
mv ${NEWBASE} ${MYBASE}
...
If the files differ, you will get an email of the differences; otherwise not.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 04:50 AM
07-15-2009 04:50 AM
Re: comparing columns in the text file
if they do, then you will have to define what columns have to match. I'd think that would be #1 (server name) and #8 (no. of cpus), but only you know for sure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 10:04 AM
07-15-2009 10:04 AM
Re: comparing columns in the text file
Oops, there is a typographical error in my script:
...
[ -s "${MYDIFF}" && mailx root -s "Files differ!" < ${MYDIFF}
...should be:
[ -s "${MYDIFF}" ] && mailx root -s "Files differ!" < ${MYDIFF}
...which should be obvious, anyway :-)
Regards!
...JRF...