to implement cntl+c from shell script on minicom
Hi Tushar, I am facing a problem with the above implementation. When target is powered on, logs coming started on minicom. After 1 second the message is coming as "Executing boot script in 3.000 seconds - enter ^C to abort". Here, we need to give cntl+c command to stop the target from auto-boot. We want to flash new image into it. Our task is to automate the process. I tried with the following code to run through runscript. set search_string="Executing boot script in 3.000 seconds" timeout 50 verbose on send "\n\r\n\r" expect { "$search_string" break timeout 2 goto abort } abort: print \nGiving cntl+c command on minicom send "\^C\r" send "\^C" send \^C\r send ^C\r expect { "RedBoot>" break timeout 3 goto panic } print \n!!!!!!Bye Bye runscript!!!!!!! sleep 2 panic: print \n!!!!!!Bye Bye Minicom!!!!!!!\n ! killall -2 minicom What i am observing is , first this script is running then minicom logs start comming. Actually it should be as first some logs should come till the search string. Then our command cntl+c should run. please help me.. Thank you in advance.. Regards, lalit
Sorry I have not done any runscript programming before, but reading this: http://lists.alioth.debian.org/pipermail/minicom-devel/2008/000904.html (search for the "^C") and referring to the documentation: http://linux.die.net/man/1/runscript and assuming the above example script runs well, it seemed that the difference now is that your script has a backslash before the control character? Just my guess???? On Sat, Jan 12, 2013 at 8:04 PM, laliteshwar yadav <lalit4294@gmail.com>wrote:
Hi Tushar, I am facing a problem with the above implementation.
When target is powered on, logs coming started on minicom. After 1 second the message is coming as "Executing boot script in 3.000 seconds - enter ^C to abort".
Here, we need to give cntl+c command to stop the target from auto-boot. We want to flash new image into it.
Our task is to automate the process.
I tried with the following code to run through runscript.
set search_string="Executing boot script in 3.000 seconds"
timeout 50 verbose on
send "\n\r\n\r" expect { "$search_string" break timeout 2 goto abort }
abort: print \nGiving cntl+c command on minicom send "\^C\r" send "\^C" send \^C\r send ^C\r expect { "RedBoot>" break timeout 3 goto panic } print \n!!!!!!Bye Bye runscript!!!!!!! sleep 2
panic: print \n!!!!!!Bye Bye Minicom!!!!!!!\n ! killall -2 minicom
What i am observing is , first this script is running then minicom logs start comming. Actually it should be as first some logs should come till the search string. Then our command cntl+c should run.
please help me..
Thank you in advance..
Regards, lalit
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Regards, Peter Teoh
participants (2)
-
laliteshwar yadav -
Peter Teoh