[K12OSN] creating accounts
Samps
samps at unplugd.com
Thu Sep 29 07:20:50 UTC 2005
gKw-X wrote:
> I need to create a large number of accounts. I've whipped up a program
> to generate a script from a text list of students. What it generates
> looks like this:
>
> groupadd "Grade3"
> groupadd "Grade2"
> groupadd "Grade1"
> groupadd "Grade6"
> groupadd "Grade7"
> groupadd "Grade4"
> groupadd "GradeK"
> groupadd "Grade5"
> useradd -c "Kayla Abad" -d /home/kabad -g Grade3 kabad -p kaab
>
> Etc, one useradd line for each student. Does that look correct? I'm
> still new to linux, how can I run this script?
>
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
>
>
>
>
Add a line at the top of your script to tell it where to find its
command interpreter:
#! /bin/bash
groupadd "Grade3"
groupadd "Grade2"
groupadd "Grade1"
groupadd "Grade6"
(you can find the name of your shell (/bin/bash) by typing echo $SHELL
on a commandline)
save your script and make it executable by changing its attributes:
chmod +x yourscript
or
chmod +x /path/to/yourscript
if you're not "standing right next to it"
run it by typing :
/path/to/yourscript
or
./yourscript
if you're able to "see" it from where you are...
cheers
Samps
More information about the K12OSN
mailing list