Hello there, I try to execute a list of command in a thread thanks to
popen.
But during command execution user may wants to interrupt / kill the
execution process.
My code looks like that :
@thread = Thread.new do
@command_list.each {|name, cmd|
IO.popen(cmd){ |@pipe|
pipe.each_line {|l|
puts l
}
}
}
end
But when i try to @thread.kill I have a broken pipe error message on
the current command execution.
How to correctly finish and kill the thread without having such
errors?
thanks.