From owner-freebsd-questions Fri Sep 14 22:50:46 2001 Delivered-To: freebsd-questions@freebsd.org Received: from wintermute.at.org (wintermute.at.org [64.69.77.155]) by hub.freebsd.org (Postfix) with ESMTP id 4957737B401 for ; Fri, 14 Sep 2001 22:50:42 -0700 (PDT) Received: from barney.intergate.ca (bambam [216.232.225.42]) by wintermute.at.org (8.11.3/8.11.3) with ESMTP id f8EN8Zv27248 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified OK); Fri, 14 Sep 2001 23:08:37 GMT Received: from FRED (fred [192.168.2.1]) by barney.intergate.ca (8.11.3/8.11.3) with ESMTP id f8F5wcu04181; Fri, 14 Sep 2001 22:58:39 -0700 Date: Fri, 14 Sep 2001 22:56:28 -0700 From: Sean Ellis X-Mailer: The Bat! (v1.51) Reply-To: Sean Ellis Organization: yes X-Priority: 3 (Normal) Message-ID: <119434402565.20010914225628@telus.net> To: dannyman Cc: freebsd-questions@freebsd.org Subject: Re: pw -h In-Reply-To: <20010914194935.F11099@toldme.com> References: <20010914165301.A3127@telus.net> <20010914194935.F11099@toldme.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello dannyman, Friday, September 14, 2001, 7:49:35 PM, you wrote: > On Fri, Sep 14, 2001 at 04:53:01PM -0700, Sean Ellis wrote: >> Hello, >> >> I'm looking to give a list of users passwords from a second list via >> a shell script, with no success. I thought this would work, >> >> #!/usr/local/bin/bash >> >> exec 6<&0 >> exec < pasz >> >> for i in `cat users` >> do >> cat | pw usermod -n $i -h 0 >> done >> >> but this gives: >> >> pw: empty password read on file descriptor 0 > What are you trying to set the passwords to? values from the file 'pasz'. 48 users in file 'users', 48 random 8 character strings in file 'pasz'. Got it to work by changing the loop to: do read line echo $line | pw usermod -n $i -h 0 done thanks, > You want like: > echo "foo" | pw usermod -n $i -h 0 > Or: > cat `$i.passwd` | pw usermod -n $i -h 0 > -danny -- Best regards, Sean mailto:sellis@telus.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message