Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Sep 2001 22:56:28 -0700
From:      Sean Ellis <sellis@telus.net>
To:        dannyman <dannyman@toldme.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: pw -h
Message-ID:  <119434402565.20010914225628@telus.net>
In-Reply-To: <20010914194935.F11099@toldme.com>
References:  <20010914165301.A3127@telus.net> <20010914194935.F11099@toldme.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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