I am new to expect but I seem to have found a strange problem. I hope somebody can help me with.
I am attempting to send a 'control-C' via expect.
My test needs to work on different Operating Systems.
Currently I am using 'send \003' this works correctly on Solaris, Linux and AIX but it doesn't seem to work on HPUX. I have tested this on two different HPUX systems with the same result.
Does anybody have an idea why this might be the case? Is there a better way to send a control-C? Or a unique way for HPUX ?
What gets captured when you use autoexpect to create a script that uses control-c?
My issue was with the HPUX terminal not remembering the setting for Control C
I had to add the follow to the script.
send -- 'stty intr <control-C>\r'
You can type the <control-C> in vi with control-v then control-c.
I hope this helps somebody in the future.