[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: adding multiple users, newuser? and vim



On Fri, Aug 24, 2001 at 05:38:56PM -0700, Mike Egglestone wrote:
> 
> joe blow
> john smith
> john doe
> 
> I would like to use "newusers" to add about 500 accounts to my system,
> but how do I quickly make the txt file look like this:
> 
> joe_blow:password:1001:1001:,,,/home/joe_blow:/bin/bash
> john_smith:password:1002:1002:,,,/home/john_smith:bin/bash

You can also use bash:

#!/bin/bash
pid=1000;
while read n1 n2; do
let pid=$pid+1
echo ${n1}_${n2}:password:${pid}:${pid}:,,,/home/${n1}_${n2}:/bin/bash
done

filter your source data with this script.  Then onto newusers.  :-)

-- 
~\^o^/~~~ ~\^.^/~~~ ~\^*^/~~~ ~\^_^/~~~ ~\^+^/~~~ ~\^:^/~~~ ~\^v^/~~~ 
+  Osamu Aoki <debian@aokiconsulting.com>, GnuPG-key: 1024D/D5DE453D  +
+  My debian quick-reference, http://www.aokiconsulting.com/quick/    +



Reply to: