in reply to Re: Making a Diff from a partial change
in thread Making a Diff from a partial change

Thanks for the answer.
I do have access to the previous version of both files (I'm storing all of this in a Subversion repository), but there may be other issues. The files are firewall configuration files, Cisco PIX, to be exact. So, they contain data like:
access-list testing permit ip host 3.3.3.3 host 22.2.2.2
access-list testing deny tcp object-group first host 4.4.4.4 eq 99
or:
object-group network first
  network-object host 9.9.9.9
The thing is, I'm not sure I'm going to be able to get enough context to dump it straight to patch...some of these sections may be as short as one or two lines.

What I'm trying to do here is give some users the ability to edit certain parts of device config, but limit their ability to edit other parts. (And, hopefully, apply some of these snippets to multiple devices, to make them all act the same.)

  • Comment on Re^2: Making a Diff from a partial change

Replies are listed 'Best First'.
Re^3: Making a Diff from a partial change
by aquarium (Curate) on Jun 08, 2005 at 21:37 UTC
    if you're giving the user the ability to edit the section, then i assume you don't want to merge the results of the edits into the same section of the other file, but you merely want to replace the whole section. do this simply by having 1 or 2 other files which have all the text excluding that section, and join it with the edited section. i.e. new file will contain: constant text 1, edited new section, and then contant text 2
    the hardest line to type correctly is: stty erase ^H