Send ctrl+C in expect script

Hi,
Am trying to transfer file via FTP using expect script from server to client
i need to interrupt the file transfer between server and client
Please help what should used in expect code..

I used
send "ctrl+c\r"
expect "Aborted"

but that didnt work.. I need what should be given in expect script..

You probably shouldn't use expect for this. Use the ksh coprocess facility instead. You can simply terminate the coprocess then by issuing kill -15 %1 or similar from the main process.

I hope this helps.

bakunin

1 Like

Do you mean while it is transferring the file? Why?
What are you trying to accomplish?

Am trying to check whether FTP abort works fine..
That why i need to interrupt the file transfer..
Because after interruption manually i got "Abort not understood by server"
So am trying to automate and use it for further test purposes..:smiley:

---------- Post updated at 12:43 AM ---------- Previous update was at 12:42 AM ----------

Thanks Bakunin.. That worked.. :slight_smile: