[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Script for add client
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Script for add client
- From: Alessandro Coppelli <coppelli_(_at_)_dsea_(_dot_)_unipi_(_dot_)_it>
- Date: Wed, 05 Dec 2001 11:28:04 +0100
- Reply-to: Alessandro_(_dot_)_Coppelli_(_at_)_dsea_(_dot_)_unipi_(_dot_)_it
Hi to all.
I wrote a file like this (users.dat) :
user_name1 guest 'Real_name_user' passwd_user1
user_name2 guest 'Real_name_user' passwd_user2
user_name3 guest 'Real_name_user' passwd_user3
user_name4 guest 'Real_name_user' passwd_user4
.....
......
I'm trying this script ( thank Sam ) for add many users :
cat users.dat | perl -ne 'print "adduser -batch $_ -shell false
-unencrypted\n"' | /bin/sh
but I'm obtain this error:
/bin/sh: <stdin>[1]: syntax error: 'newline' unexpected .
If I try with bash shell:
cat users.dat | perl -ne 'print "adduser -batch $_ -shell false
-unencrypted\n"' | /usr/local/bin/bash
I obtain :
/usr/local/bin/bash: line 1 :syntax error near unexpected token
'passwd_user'
/usr/local/bin/bash: line 1 : 'adduser -batch name_user guest
'Real_name' passwd'
Are there perhaps some problems with symbol " or symbol ' in
command line ?
Alessandro
Visit your host, monkey.org