- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Doing diff on portions of files
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
11-13-2002 06:01 PM
11-13-2002 06:01 PM
I have 2 files, file1 and file2 with the following contents:
fil1:
const int errBuffLen=30;
static char errBuff[errBuffLen+1];
String lastMsg;
error::genmessagef(){
...
}
error::genmessage(){
...
}
error::getType(){
...
}
file2:
logfile::msg(){
...
}
logfile::genmessagef(){
...
}
logfile::genmessage(){
...
}
logfile::logging(){
...
}
I'm interested to list only the differences of the files containing the portions genmessage(){...} and genmessagef(){...} contained in files file1 and file2. i.e I'd like to see the differences of the functions genmessage(){...} and genmessagef(){...} in file1 and file2.
I was wondering how do I use #diff to specify the patterns which I want to search for its difference within files? Or is there any other method/scripts which need to use?
Could someone kindly show me how it's done?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 06:49 PM
11-13-2002 06:49 PM
Re: Doing diff on portions of files
I dont know if this will help you or not, but I generally use sdiff to view files side by side.
do a man on sdiff and see if this is what you want.
alternatively you can use diff -s which sort of does the same thing but doesn't list them side by side.
I hope this has helped you somewhat.
Cheers
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2002 07:24 AM
11-15-2002 07:24 AM
Re: Doing diff on portions of files
I think you could write a Perl script that would use some regular expressions to pull the the parts you want to compare. I've been playing with it but I haven't gotten it right yet. Maybe some of the resident Perl wizards will see this and post a clever way to do it.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2002 07:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2002 07:41 AM
11-15-2002 07:41 AM
Re: Doing diff on portions of files
http://search.cpan.org/search?query=diff&mode=all will show
?? http://search.cpan.org/author/RBS/Text-Diff-0.35/
?? http://search.cpan.org/author/NEDKONZ/Algorithm-Diff-1.15/