Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Balancing Coding Time And Code Quality

by Limbic~Region (Chancellor)
on Dec 04, 2003 at 00:34 UTC ( #312061=note: print w/replies, xml ) Need Help??


in reply to Re: Balancing Coding Time And Code Quality
in thread Balancing Coding Time And Code Quality

hossman,
I probably should have mentioned that I thought of that immediately. The problem is that I wasn't sure diff was perfect, and I didn't have time to find out. I figured it was possible, even sorted, for the same filename to be several hundereds of lines away from one another depending on how divergent the two servers were.

If the administrator that made this request hasn't already taken steps to modify the two systems, I will compare the results of my script against what diff says to see. I just thought diff assumed a certain amount of similarity and gave up if the lines were too far apart.

Cheers - L~R

Update: After googling a bit, I found enough to convince me that diff would not have worked

  • Comment on Re: Re: Balancing Coding Time And Code Quality

Replies are listed 'Best First'.
Re: Re: Re: Balancing Coding Time And Code Quality
by waswas-fng (Curate) on Dec 04, 2003 at 00:48 UTC
    man comm

    comm -2 -3 master slave >unique_to_master comm -1 -3 master slave >unique_to_slave comm -1 -2 master slave >union_master_slave


    -Waswas
      waswas-fng,
      Cool! I am not sure how I missed this. So as long as both files are sorted, comm will be 100% correct no matter how divergent the two servers are?

      I will have to try it.

      Cheers - L~R

        Yes, I have used it much over the years. pre sorted lists are 100%.


        -Waswas


        Edited to add: the only exception is on some OSes where they do not support largefiles and the input files are larger than 2gb. Whats even cooler about it is that uoi can pipe comms together and test for in file one and two but not three etc. comm is nice.
      Nice, thanks!

      But isn't the 3rd line be the intersection and not the union?

      comm -1 -2 master slave >intersection_master_slave

      Mike
Re: Re: Re: Balancing Coding Time And Code Quality
by hossman (Prior) on Dec 04, 2003 at 01:06 UTC

    Recursively diffing all of the acctual files on each box probably wouldn't have been a good idea, but i've never had a problem diffing sorted lists -- no matter how much difference there is. (I'm curious as to exactly what you found with google convinced you diff would have been bad)

    As many people have allready pointed out, "comm" works just as well (if not better) then diff ... i just tend to dislike the whole "tabed" output of comm ... but "comm -1" followed by "comm -2" would be great if you didn't mind having two seperate lists.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://312061]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-05-25 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?