Add User Script

Adam Ellis AdamE at AccelGrp.com
Mon Oct 22 13:27:02 GMT 2001


PERFECT!  That works like a charm.  Thanks Les.

-----Original Message-----
From: Les Gondor [mailto:les at gandalfgraphics.com]
Sent: Monday, October 22, 2001 4:22 PM
To: Adam Ellis
Subject: RE: Add User Script


Check for the presence of a ^M at the end of each line in 
/mnt/PDC1-UsrSync/user.diff.
Text files written by DOS and Windows applications have CRLF line 
terminators, while UNIX-derived
systems require only LF, thus the extraneous ^M. Or just try the 
following as a quick fix:

	tr -d '\015' </mnt/PDC1-UsrSync/user.diff | while read Foo; do
useradd 
$Foo; done

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 22/10/01, 04:08:17 PM, Adam Ellis <AdamE at AccelGrp.com> wrote regarding 
RE: Add User Script:


> > sh test.sh useradd: invalid user name `dccut ' useradd: invalid user
name
> `dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name
> `dcshp '
> ^^^^^^^^^^^^^^^^^^^^^^^^

> Revised, this is command runs in the terminal:

> > sh test.sh
> 'seradd: invalid user name `dccut
> 'seradd: invalid user name `dclam
> 'seradd: invalid user name `dcprep
> 'seradd: invalid user name `dcshp


> -----Original Message-----
> From: Adam Ellis [mailto:AdamE at AccelGrp.com]
> Sent: Monday, October 22, 2001 3:35 PM
> To: 'samba at lists.samba.org'
> Subject: Add User Script


> I am trying to read in a list of users from a file and automatically 
create
> users from that.  Here is what I thought would work:

> #!/bin/sh
> cat /mnt/PDC1-UsrSync/user.diff | while read Foo; do useradd $Foo; done

> Contents of the user.diff file:

> dccut
> dclam
> dcprep
> dcshp


> But here is what I get when I run the script:

> > sh test.sh useradd: invalid user name `dccut ' useradd: invalid user
name
> `dclam ' useradd: invalid user name `dcprep ' useradd: invalid user name
> `dcshp '

> Any ideas?  Thanks,

> AE

> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba

> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba




More information about the samba mailing list