On Mon, 18 Aug 2003 09:36:47 -0500
"Raymond Norton" <admin at lctn.org> wrote:
>I am trying to use webmin to batch create 1200 users. I can work things
>out in excel and export all fields to a csv except the homdir filed,
>which needs to be /home/"usersname". Is there a variable for this, or a
>way of getting this done with another method?
>
>This is the format I am working with:
>
>create:username:passwd:uid:gid:realname:homedir:shell:min:max:warn:ina
>ctive: expire


if you have lines that aready look like this:

create:joe:passw0rd:101:100:Joe Shmoe::/bin/bash/:0:0:0:0:0

you could use awk easily (or perl if you like that sort of thing)

awk -F: '{ printf("%s:%s:%s:%s:%s:%s:/home/%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,$2,$8,$9,$10,$11,$12); }'

I havnt tested that, but its a pretty basic awk command, just make sure you count the number of fields. If you have a different separator than the colon, just change -F: with -F, or whatever you use.

Jay

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list