Job Scheduling

Hi All,

I am new to unix and i have a task in front of me.
The code part is "android update sdk" . I need to crontab this process.
Hence i have written a script that runs the above command and sends a mail once the update is done. The problem with the automation is the installer asks for a license agreement in between. How can i accept it in the script??? Hope will get a solution for this ..

Thanks

By using expect or perhaps a here-document in your script...

vbe,

I tried Expect and send commands,
But its not working:(.
Any other solutions????:confused:

Thanks.

What exactly does it ask you do type? Perhaps you could feed it through standard input:

printf "yes\n" | android update sdk

Or you might just have to do it manually. The SDK can't be updated that often, right? I mean how can you be expected to develop anything if the floor beneath your feet keeps moving?

Scott,

I agree with your statement, but that is what is the task in front of me now.
The piece of code that you have mentioned works fine.But the task is still incomplete because the installer asks for the license agreement twice. The code you have mentioned feeds "YES" once.The second time the installer waits for the input some 15 secs and cancel off the downloading process related to the second License. Can you please look into this??? I tried to alter your code but i failed in finding a solution.

Thanks.

All,

I tried the expect, spawn and send commands for the above problem.
I am facing this error when i execute the .exp file.

invalid command name "y/n"
    while executing
"y/n"
    invoked from within
"expect "[y/n]:" { send "Y\r" }"
    (file "./enter.exp" line 5)

Please do help me in solving this.

Thanks.