#!/bin/sh
#  -*- TCL -*- Created: ramsan Oct-1997, Modified: ramsan Oct-1997


# the next line restarts using wish \
	exec wish8.0 "$0" "$@"

set inum 0
foreach i [glob *.geo] {
    set gidp [file rootname $i].gid
    file mkdir $gidp
    file copy -force $i $gidp/$i

    set f [open batch12345 w]
    puts $f "Files read $gidp"
    puts $f "escape escape escape escape Files SaveAsciiProj $gidp yes"
    puts $f "escape escape escape escape quit"
    close $f
    exec /home/ramsan/bin/gid  -n -b batch12345
    file copy -force $gidp/$i .
    file delete -force $gidp

    pack [label .l$inum -text "converted $i"]
    update
    incr inum
}

file delete batch12345

pack [button .b -text Close -command "destroy ."]