all output catched
This commit is contained in:
17
shellbox.tcl
17
shellbox.tcl
@@ -23,7 +23,11 @@
|
||||
# kill terminates the shell
|
||||
#
|
||||
|
||||
set version {$Id: shellbox.tcl,v 1.3 2003/03/10 10:04:57 zimoch Exp $}
|
||||
regsub -all {\$} {shellbox.tcl by Dirk Zimoch
|
||||
$Id: shellbox.tcl,v 1.4 2003/04/10 12:19:57 zimoch Exp $
|
||||
$Source: /cvs/G/EPICS/App/scripts/shellbox.tcl,v $
|
||||
$Revision: 1.4 $
|
||||
$Date: 2003/04/10 12:19:57 $} {} version
|
||||
|
||||
proc createServer {port {paranoid 0}} {
|
||||
if [catch {
|
||||
@@ -42,7 +46,7 @@ proc createServer {port {paranoid 0}} {
|
||||
|
||||
proc bgerror {args} {
|
||||
global errorInfo
|
||||
puts stderr $errorInfo
|
||||
catch {puts stderr $errorInfo}
|
||||
}
|
||||
|
||||
set channels {}
|
||||
@@ -54,15 +58,14 @@ proc connectionHandler {channel addr port} {
|
||||
fconfigure $channel -blocking no -buffering line
|
||||
fileevent $channel readable "inputHandler $channel"
|
||||
forwardOutput "**** new client $clientinfo($channel) ****"
|
||||
puts $channel "**** '$command' running ****"
|
||||
catch {puts $channel "**** '$command' running ****"}
|
||||
lappend channels $channel
|
||||
puts $channel "clients:\n[getClientlist]"
|
||||
catch {puts $channel "clients:\n[getClientlist]"}
|
||||
forwardInput "\n"
|
||||
}
|
||||
|
||||
proc closeChannel {channel} {
|
||||
global channels clientinfo
|
||||
puts "closing connection to $clientinfo($channel)"
|
||||
catch {puts $channel "**** see you later ****"}
|
||||
set index [lsearch $channels $channel]
|
||||
set channels [lreplace $channels $index $index]
|
||||
@@ -96,7 +99,7 @@ proc inputHandler {channel} {
|
||||
|
||||
proc forwardInput {data} {
|
||||
global pipe
|
||||
puts -nonewline $pipe $data
|
||||
catch {puts -nonewline $pipe $data}
|
||||
}
|
||||
|
||||
proc outputHandler {channel} {
|
||||
@@ -139,7 +142,7 @@ proc startProgram {} {
|
||||
if [catch {
|
||||
set pipe [open |$command RDWR]
|
||||
} msg] {
|
||||
puts stderr $msg
|
||||
catch {puts stderr $msg}
|
||||
exit 3
|
||||
}
|
||||
fconfigure $pipe -blocking no -buffering line
|
||||
|
||||
Reference in New Issue
Block a user