Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I'm busy with a user migration task... I have to develop a script (let's call it myscript) which puts new users into a LDAP directory. The script has to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    2

    interactive script in script


    Hi,

    I'm busy with a user migration task...

    I have to develop a script (let's call it myscript) which puts new users into a LDAP directory. The script has to fetch all the user information (name, UID, GID, password, home directory, shell, description) from file.
    There is another script (let's call it corpscript) that does the same thing but interactively. It prompts for the user name, password, etc.

    I have the script (myscript) that reads the source file perfectly. I put "corpscript" and its arguments into "myscript" to put the new users into the LDAP. Actually, I need to solve somehow, to use the interactive (corpscript) non-interactively. I have all the user's attributes parsed, I just need to give them to the corpscript as user responses.

    Any idea would be appreciated!
    Thanks,
    George

  2. #2
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    155
    Is the 'corpscript' a shell/text-mode script, or a GUI application? If it is a script, it sounds like it woud be easiest to modify it to simply accept input from a file or from its standard input. Or, you could see from that script how it writes the data to the destination, and add similar code to your own script.
    The tool 'expect' is used to supply input to interactive text-mode applications. Perhaps it can be used for your purpose.

    --- rod.
    Stuff happens. Then stays happened.

  3. #3
    Just Joined!
    Join Date
    Oct 2010
    Posts
    2
    Thank you for your answer. Corpscript is a shell/text script and it is not allowed to modify it.
    Actually, I applied your second suggestion:
    "Or, you could see from that script how it writes the data to the destination, and add similar code to your own script."

    Regards,
    Gyorgy

Posting Permissions

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