From owner-freebsd-questions Thu Aug 26 12:45:10 1999 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id C53E2153C5 for ; Thu, 26 Aug 1999 12:44:57 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from lithium.scientia.demon.co.uk ([192.168.0.3] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.032 #1) id 11K4Vh-00019Q-00; Thu, 26 Aug 1999 19:44:29 +0100 Received: (from ben) by lithium.scientia.demon.co.uk (Exim 3.032 #1) id 11K4Vf-0000mI-00; Thu, 26 Aug 1999 19:44:27 +0100 Date: Thu, 26 Aug 1999 19:44:26 +0100 From: Ben Smithurst To: "Francis A. Vidal" Cc: FreeBSD Questions Subject: Re: pw useradd -h option Message-ID: <19990826194426.A2945@lithium.scientia.demon.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Francis A. Vidal wrote: > can someone show me how to implement the `-h' option in a script? i'm > currently testing this script: > > #!/bin/sh > # > while read username first middle last password > do > fullname="$first $middle. $last" > ... > /usr/sbin/pw useradd $username -k /usr/share/uskel -s /sbin/nologin \ > -d $homedir -c $fullname -m > done > > how do i change their password non-interactively? echo $password | /usr/sbin/pw useradd $username -h 0 plus the other args after the -h 0, as in your script above. > BTW, is it normal for the UID to have the same value if the -N option > is used during the entire lifetime of the script? Yes, looking at the manual, I would assume so. Since you're not specifying a UID, and you're not updating the password database when you use -N, the same UID will be used every time. -- Ben Smithurst | PGP: 0x99392F7D ben@scientia.demon.co.uk | key available from keyservers and | ben+pgp@scientia.demon.co.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message