[K12OSN] creating accounts

NONE NONE gKw-X at shaw.ca
Fri Sep 30 22:02:05 UTC 2005


Thank you, that works!

Now, I must be an idiot because the script doesn't work (though now the commands themselves, pasted individually, do!).

Here is my test script:

#! /bin/bash

groupadd grade1

useradd -c "A Student" -m -G grade1 astudent

echo "apassword" | passwd --stdin astudent

I run it with "sh -x filename" and it outputs:

+ groupadd $'grade1\r'
 is a not a valid group name
+ useradd -c 'A Student' -m -G grade1 $'astudent\r'
useradd: unknown group grade1
+ echo apassword
+ passwd --stdin astudent
passwd: Unknown user name 'astudent'.

I'm guessing the problem is I don't know anything about the syntax it is expecting. Sorry for the dumb question, how do I fix this?

----- Original Message -----
From: Shahms King <shahms at shahms.com>
Date: Friday, September 30, 2005 1:47 pm
Subject: Re: [K12OSN] creating accounts

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> You can use the '--stdin' parameter to 'passwd' as root to tell it to
> read "tokens" (input) from the standard input and script password
> setting similarly to:
> 
> # echo "<password>" | passwd --stdin <username>
> 
> - --
> Shahms E. King <shahms at shahms.com>
> Multnomah ESD
> 
> Public Key:
> http://shahms.mesd.k12.or.us/~sking/shahms.asc
> Fingerprint:
> 1612 054B CE92 8770 F1EA  AB1B FEAB 3636 45B2 D75B
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
> 
> iD8DBQFDPaRl/qs2NkWy11sRAsqIAJ9t0oe1oB4ITwOdEP7wr3mBwNaTFQCgy2FM
> ya4mAF+K2krSIG96Kh5pPVc=
> =ObtC
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <" target="l">http://www.k12os.org>
> 




More information about the K12OSN mailing list