[95516] in RedHat Linux List

home help back first fref pref prev next nref lref last post

=?iso-8859-1?Q?Re:_comparing_Two_different_passwd=B4s?=

daemon@ATHENA.MIT.EDU (Anthony E. Greene)
Mon Oct 19 08:44:11 1998

Date: Mon, 19 Oct 1998 14:40:16 +0200
To: redhat-list@redhat.com
From: "Anthony E. Greene" <agreene@pobox.com>
In-Reply-To: <3.0.5.32.19981019095546.0079f4f0@cwb.conex.com.br>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

At 09:55 1998-10-19 -0200, Psychotron wrote:
>	My machine is going down and I need to move the passwd file to another
>server, which has a different passwd. Both of them are huge files. All I
>need is just to find a way to discover wich user names are common to both
>of them, in order for me to change them. But I can=B4t find anyway to do=
 this
>:( Any help will be greatly appreciated!!!

Create a perl script that

	1. Reads in a line and parses out the characters preceding the first colon.

	2. Writes the result to a file.

Do the above to both files. Then create another script that

	1. Reads a line from the smaller file.

	2. Greps the larger and outputs the name if it's found in the larger file.


There are more elegant ways to do this, but the above is off the top of my
head. You could spend more time thinking about this than it would take to
do it.


 Tony
 --
 Anthony E. Greene <agreene@pobox.com>
 Homepage and PGP Key: <http://www.pobox.com/~agreene/>


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


home help back first fref pref prev next nref lref last post