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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating script 1

Status
Not open for further replies.

krishsays

IS-IT--Management
Dec 3, 2004
45
GB
Hi ,

I want to write a unix script which can automate a process something given below :
---------------------------
unix prompt# lh console

configurator > getObject Resource "clarify-eu" > clarify-eu.xml

configurator > quit

#
-----------------------------
Logic here is that after i give " lh console" command it goes into " configurator prompt mode and then i need to give the getObject command. Now the problem is I dont know how to transfer the control of script to configurator mode and how to make it expect the command at that propmt and run that command.
this process is same as what we do in cases of databases that is once we give " sqlplus " command we enter into database command and prompt and then we use database commands there.
Please can somebody help in this
Thanks,
krishan
 
Have you tried something like this ?
echo "getObject Resource \"clarify-eu\" > clarify-eu.xml\nquit | lh console

You have to read the lh man page to see if lh can get commands from iits standard input (the classical way: lh - )

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Another possible way is to play with expect

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV

thanks buddy you are the man ...the command you gave worked with little tweak .

Krishan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top