Hi
i need to have a update for a file that updates only the last modified content from another file....
say for example....if file A is having content like
.
.
.
hatxxxx
catxxxx
ratxxxx
and file B(the file to be updated is having content as
hatxxxx
catxxxx
then file B has to be updated/appended with the last modified content(i.e rat in this case) so as to look like
hatxxxx
catxxxx
ratxxxx
plz help someone with a script.
My understanding of what you are after:
Scan through file A looking for a block of text identical to the entire contents of file B.
Once found, read everything after that block of text in file A and append it to file B.
dd is a method of copying data around, if= is where you specify the file (or device) to read from, of= is for the output file (or device) bs=1 means a block size of 1 byte (ie we read byte by byte), skip= says how many blocks to skip before beginning the copy, count= says how many blocks to copy.
I just had a play with this on Solaris, it looks like comm works a little differently.
On your system, with the above example, does comm -3 file1 file2 produce the string 'ratxxxx' even if file1 has a lot of lines at the start (ie before 'hatxxxx')?