Stdin/out with cygwish80.
C. R. Oldham
cro@nca.asu.edu
Wed Aug 16 15:15:00 GMT 2000
Greetings,
I wrote a little tcl/tk script to grab a passphrase from the user and
output it to stdout. Unfortunately, cygwish80 does not appear to open
stdout or allow tcl to "puts" to it. Am I missing something here?
When run on my Linux box the attached script prints the contents of the
entry field on stdout when <Enter> is pressed or the OK button is
clicked. The same script when run under Cygwin prints nothing. Any
suggestions? Thanks.
--
/ Charles (C. R.) Oldham | NCA Commission on Schools \
/ Director of Technology | Arizona State University \
/ "cro at nca dot asu dot edu" | V:480/965-8703 F:480/965-9423 \
| http://www.nca.asu.edu/ |
-------------- next part --------------
proc MaxLineLength { file } {
set max 0
if [catch {open $file} in] {
return $in
}
foreach line [split [read $in] \n] {
set len [string length $line]
if {$len > $max} {
set max $len
}
}
return "Longest Line is $max characters"
}
proc doit { w passphrase } {
puts stdout $passphrase
flush stdout
destroy $w
}
. config -borderwidth 10
wm title . "ssh-askpass"
entry .e -width 30 -bg white -relief sunken -show "*"
button .ok -text "OK " \
-command { doit . [.e get] }
bind .e <Return> {doit . [.e get]}
button .cancel -text "Cancel " \
-command { destroy . }
label .label -text "Enter passphrase"
pack .label .e .ok .cancel -side top -pady 3
More information about the Cygwin
mailing list