Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I need a script to compare two files. I don’t care if it is in gerp, sed, awk or perl. I like to compare /etc/passwd to /etc/mail/aliases. If a ...
  1. #1
    Just Joined!
    Join Date
    Aug 2005
    Posts
    3

    Scripts

    Hi,

    I need a script to compare two files.
    I don’t care if it is in gerp, sed, awk or perl.
    I like to compare /etc/passwd to /etc/mail/aliases.
    If a user in /etc/passwd is not in /etc/mail/aliases, I would like the output to be redirect to a third file.

  2. #2
    Just Joined!
    Join Date
    Jul 2005
    Posts
    19

    try use diff

    Hi,
    Try using a bash script with diff as in:

    #!/bin/bash
    diff /etc/passwd /etc/mail/alias > ~/filename.txt

    Regards

  3. #3
    Just Joined!
    Join Date
    Aug 2005
    Posts
    3
    Thanks i will give it a try.

  4. #4
    Just Joined!
    Join Date
    Aug 2005
    Posts
    3
    I'm sorry that did not work, the two file are to different. This work best with two versions of the same file or an edit of one file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •