How to add/change entries use diff and sed

Discussion in 'Programming/Scripts' started by tiffany C, Jul 26, 2007.

  1. tiffany C

    tiffany C New Member


    I am new on linux bash script. I am asking to do a "diff" on 2 files and then add/change file1 based on the comparsion with file2. I knew I have to use "diff" and "sed" to do it, but I have no idea how to put them together. Anybody has any idea? What is the regular expression should i use for sed.

  2. cfajohnson

    cfajohnson New Member

    Use patch, not sed.

    However, if you just want file1 to be the same as file2, why not copy file2 to file1?

Share This Page