Nice--2 solutions for adding/removing users--and a friend wrote one for me as well makes 3. Is there an online space where these 'local solutions' could be placed and possibly developed? Or at least they could each be given their own page on the ubuntu/edubuntu wiki. If I had known about other people's work I wouldn't have bothered this friend with creating a new one. What do you-all think? Should we add a few pages to the edubuntu wiki?<br>
<br>About the comparison between CLI and GUI, all I've got to say is that 'one man's meat is another man's poison'. While both CLI and GUI have their non-overlapping strengths, preference is not only based on the tool (and the task) but also in the hand that wields the tool. While there's a certain joy for me in effectively using CLI, my hand <i>likes</i> GUI. :-)<br>
<br>David<br><br><div class="gmail_quote">On Wed, Jun 17, 2009 at 11:20 AM, Gerald Drouillard <span dir="ltr"><<a href="mailto:gerrylist@drouillard.ca">gerrylist@drouillard.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 6/17/2009 12:01 PM, Andy Figueroa wrote:<br>
> I love good gui tools for managing users, but they are tedious and time<br>
> consuming for making many changes, additions, or deletions.<br>
><br>
> Depending on what user and group items are being managed, the most powerful<br>
> tool for changing group permissions for established users is directly<br>
> editing the /etc/group file as root using a text editor.<br>
><br>
> Likewise, adding and deleting users is most expediently done by the<br>
> administrator as root from the command line. For adding many users at a<br>
> time, a little shell script like that below makes my day. This is an actual<br>
> except from the script that I use:<br>
><br>
</div>Here is the one I use that seems a little easier....IMO:<br>
<br>
#!/bin/bash<br>
#list all users...<br>
#cut -d: -f1 /etc/passwd<br>
#space delimited file of users separated by line returns<br>
#groupadd student<br>
<br>
toLower() {<br>
echo $1 | tr "[:upper:]" "[:lower:]"<br>
}<br>
toUpper() {<br>
echo $1 | tr "[:lower:]" "[:upper:]"<br>
}<br>
logIt() {<br>
echo $1<br>
echo $1 >>log.txt<br>
}<br>
rm log.txt<br>
unixfile=unix_user_list.txt<br>
#Remove any CRLF's<br>
tr -d "\015" < students.txt > $unixfile<br>
cat $unixfile | \<br>
while read FIRSTNAME MIDDLE LASTNAME PASSWORD<br>
do<br>
username=`toLower ${FIRSTNAME}.${LASTNAME}`<br>
egrep "^$username" /etc/passwd >/dev/null<br>
if [ $? -eq 0 ]; then<br>
logIt "Exists: $username"<br>
else<br>
homedir=/home/student/$username<br>
xpass=`mkpasswd $PASSWORD`<br>
# echo $username $PASSWORD $xpass<br>
useradd -f 360 -d $homedir -c "$FIRSTNAME $MIDDLE $LASTNAME" -m<br>
-s /bin/bash -g student -G<br>
dialout,cdrom,floppy,audio,dip,plugdev,scanner -p $xpass "$username"<br>
if [ $? -eq 0 ]; then<br>
chmod 700 $homedir<br>
logIt "Added: $username $PASSWORD"<br>
else<br>
logIt "Error $?: ${username}"<br>
fi<br>
fi<br>
done<br>
rm $unixfile<br>
<font color="#888888"><br>
<br>
--<br>
Regards<br>
--------------------------------------<br>
Gerald Drouillard<br>
Technology Architect<br>
Drouillard & Associates, Inc.<br>
<a href="http://www.Drouillard.biz" target="_blank">http://www.Drouillard.biz</a><br>
</font><div><div></div><div class="h5"><br>
--<br>
edubuntu-users mailing list<br>
<a href="mailto:edubuntu-users@lists.ubuntu.com">edubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/edubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/edubuntu-users</a><br>
</div></div></blockquote></div><br>