Score:0

How to spawn an already run process in expect script

cn flag

I've already run a process, for example "fdisk /dev/sda" with the PID of "2000"

Now I execute expect script and I want expect to take control of stdin and stdout of my desired PID (2000) , so I can use "expect" and "send" command and interact with my process.

"spawn" command in expect normally create a process rather than connecting to it. but you can combine it with "open" command from tcl language but this command also opens files and some other things.

Any way to make this happen?

cn flag
You might want to ask on stackoverflow instead.
Mohammad Reza Moghaddasi avatar
cn flag
@glennjackman thanks .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.