Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2008 09:34:38 +0200
From:      Jonathan McKeown <jonathan+freebsd-questions@hst.org.za>
To:        freebsd-questions@freebsd.org
Subject:   Re: Password file migration help
Message-ID:  <200801310934.38885.jonathan%2Bfreebsd-questions@hst.org.za>
In-Reply-To: <47A0CA04.7060100@calarts.edu>
References:  <47A0CA04.7060100@calarts.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 30 January 2008 21:03, Sean Murphy wrote:
> I have a FreeBSD 5.4 system and would like to migrate users in the
> password file with UIDs 3000 through 5000 to a FreeBSD 6.3 system on a
> running on a separate box.  Is there a way to export just those users?

I'd probably sort /etc/master.passwd and pipe through awk:

sort -t ':' -k3,3n /etc/master.passwd | \
  awk -F ':' '$3 ~ /^3[0-9][0-9][0-9]/, $3 ~ /^5/ { print }'

This will sort /etc/master.passwd numerically on the third field, uid, and
then give you all the lines starting with the first one where the uid is a
3 followed by at least three digits, up to and including the first one after
that where the first digit of the uid is a 5.

If you capture the output you should be able to merge it on the new host.

Jonathan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801310934.38885.jonathan%2Bfreebsd-questions>