#!/usr/bin/env -S tclsh
proc relay fd {
set out [read $fd]
if {{} ne $out} {
puts -nonewline $out
flush stdout
}
if {[eof $fd]} {
close $fd
set ::forever 1
}
}
set fd [open "| fossil clone
https://chiselapp.com/user/LuoChunlei/repository/luocl luocl.fossil 2>@1" r] chan configure $fd -blocking 0 -buffering none
fileevent $fd readable [list relay $fd]
vwait ::forever
return
run the tcl script of the above, can not obtain the following [fossil
clone] output, the [script] output in the last. how can I output the
progress in the same line???
[fossil clone
https://chiselapp.com/user/LuoChunlei/repository/luocl luocl.fossil 2>@1] output:
Round-trips: 2 Artifacts sent: 0 received: 146
Clone done, sent: 584 received: 79948 ip: 74.208.146.128
Rebuilding repository meta-data...
100.0% complete...
Extra delta compression...
Vacuuming the database...
project-id: 2d2b2705f0290a1ad6d74e67624da7be0f311728
server-id: bc6f8571ca049ec687520d9a762d154560fa7438
admin-user: luocl (password is "2SrHjLvRFP")
[script] output:
Round-trips: 1 Artifacts sent: 0 received: 0
Round-trips: 1 Artifacts sent: 0 received: 143
Round-trips: 2 Artifacts sent: 0 received: 143
Round-trips: 2 Artifacts sent: 0 received: 146
Clone done, sent: 582 received: 79948 ip: 74.208.146.128
Rebuilding repository meta-data...
0.0% complete...
0.6% complete...
1.3% complete...
.
.
.
99.3% complete...
100.0% complete...
Extra delta compression...
Vacuuming the database...
project-id: 2d2b2705f0290a1ad6d74e67624da7be0f311728
server-id: 2c8b2e79dcce66c9f4aaeff964ce51660f9e1788
admin-user: luocl (password is "Mf3AVgedCu")
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)