At Thu, 22 Sep 2005 17:01:24 +1000, Vino Fernando Crescini wrote:
> > If you want a list of all "invalid" usernames in smbpasswd that is
> > not in allusers.txt, this way might be easier:
> > cut -d: -f1 smbpasswd | while read name; do
> > grep -q "${name}\$" /tmp/list || echo $name
> > done
>
> oops. that's allusers.txt instead of /tmp/list. the output of
> this can then be fed to smbpasswd -x
Since apparently I've been getting some experience with large datasets
lately, this version scales better:
sort allusers.txt > sortedusers.txt
sort /etc/samba/smbpasswd | join -v1 -t: -o1.1 - sortedusers.txt | \
xargs -n 1 smbpasswd -x
--
- Gus
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html