#!/usr/bin/expect # Um programinha pra passear por uma lista de escripts (preu ver quais # sÆo os que estÆo com headers bons). proc readfile {fname} { set channel [open $fname r]; set bigstr [read $channel]; close $channel return $bigstr } # (find-fline "~/EXPECT/seefonts") # (eeman "expect" "stty args") # (eeman "expect" "interact \\[string1") # (find-node "(sh-utils)Combination" "\n`cooked'") # (find-node "(sh-utils)Combination" "\n`raw'") # (find-node "(sh-utils)Special" "`min N'") # (find-node "(sh-utils)Local" "`icanon'") proc fname {i} {global argv; lindex $argv [expr $i-1]} proc draw {i} { set fname [fname $i] set fstr [readfile $fname] regexp "^(#\[^\n\]*\n)*" $fstr fstr puts "\033\[H\033\[J$i - $fname:\n$fstr" } set timeout -1 stty -icanon min 1 set i 1 set n $argc draw 1 expect_user { "<" {if {$i>1} {incr i -1; draw $i}; exp_continue} ">" {if {$i<$n} {incr i; draw $i}; exp_continue} "e" {exec gnuclient -q [fname $i]; exp_continue} "q" exit }