Find the answer to your Linux question:
Results 1 to 3 of 3
hi I am using this workaround maybe someone has a better a idea but this is What I am doing creating multiples users scripting I got a text file name ...
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    21

    multiples users from text file scripted

    hi

    I am using this workaround maybe someone has a better a idea but this is What I am doing creating multiples users scripting


    I got a text file name users

    users text file
    userid Description

    Code:
    mmaria Accounting Department
    lana   Production Department
    and I am using this script to create the users and assign a Description
    but the command useradd is not doing anything not adding users neitehr description

    Code:
    while IFS= read -r l1 l2 l3
    do
    useradd -c "$l2 $l3" $l1
    done <users
    please some ideas

    thanks a lot

  2. #2
    Just Joined!
    Join Date
    Aug 2005
    Posts
    65
    Code:
    while read -r l1 l2 l3
    do
    useradd -c "$l2 $l3" $l1
    done <users
    does this solve ur problem ?

  3. #3
    Just Joined!
    Join Date
    Dec 2006
    Posts
    21
    Quote Originally Posted by deepinlife View Post
    Code:
    while read -r l1 l2 l3
    do
    useradd -c "$l2 $l3" $l1
    done <users
    does this solve ur problem ?
    yeah removing IFS did the job

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...