[95536] in RedHat Linux List

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

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

daemon@ATHENA.MIT.EDU (Kevin Smith)
Mon Oct 19 10:36:07 1998

Date: Mon, 19 Oct 1998 09:39:06 -0500 (CDT)
From: Kevin Smith <kevin@mtsu.edu>
To: redhat-list@redhat.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

On Mon, 19 Oct 1998, Psychotron wrote:

> Hello All!!
>=20
> =09My 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!!!
>=20

Assuming you are using a bash shell:

-- cut --
for i in `cut -d: -f1 /etc/passwd`
do
=09grep $i `cut -d: -f1 /etc/passwd2`
done
-- end --

That will show you which usernames are in both files...
=20
-----
Kevin Smith
kevin@mtsu.edu

Machines take me by surprise with great frequency.
- Alan Turing


-- 
  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