[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script for add client



 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