Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding new users and assigning passwords

Status
Not open for further replies.

whizza

Programmer
Feb 4, 2002
16
0
0
GB

The commands in 'pem' work ok if I type them
at the command line. Why will they not work
in a script?


Red Hat Linux release 7.1 (Seawolf)
Kernel 2.4.2-2 on an i686

# ls -l pem
-rwxrwxrwx 1 root root 94 Jul 8 19:44 pem

# cat pem
/usr/sbin/useradd -g popusers -s /bin/false merves02
echo d2ksd6b | passwd --stdin merves02

# ./pem
'seradd: invalid user name `merves02
'asswd: Unknown user name 'merves02

#


 
Hello

I would use send/expect to do this ( if you have to ).
I never had much luck with the approach you are using either. See man expect

Neil
 
Sorted. Needed to run dos2unix on the script.
 
Can any tell me how to create multiple users in linux on fly with any script or command.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top