Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Aug 1995 09:55:37 +0300
From:      kallio@jyu.fi (Seppo Kallio)
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        wsantee@wsantee.oz.net (Wes Santee), questions@freebsd.org
Subject:   Re: Automating removal of users password
Message-ID:  <v0151011dac4b6792907a@[130.234.41.39]>

next in thread | raw e-mail | index | archive | help
At 11:03 7/8/95, Michael Smith wrote:
>Wes Santee stands accused of saying:
>> umask 077
>> chdir /etc
>> /usr/bin/grep -v ${username} master.passwd > master.passwd.XXXXXX
>> /usr/sbin/pwd_mkdb -p master.passwd.XXXXXX
>> /bin/rm -f master.passwd.XXXXXX
>
>That should be  grep -v ^${username} ... (Match only at the beginning of
>a line)
>

I would use

 grep -v "^${username}:"   ...

So user  msmithma is not deleted when you delete msmith

Seppo



--
 +--    Seppo Kallio       -----             kallio@jyu.fi              ---+
 !    Computing Center       !   Fax +358-41-603611 Phone +358-41-603606   !
 !  University of Jyvaskyla  !         http://www.jyu.fi/~kallio           !
 +--      Finland          --+--            62.14N 25.44E               -- +





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v0151011dac4b6792907a>