1#
2# Rewrites all .c and .h files stripping CR characters
3# inserted by DOS/Windows text editors
4#
5foreach fname [glob *.c *.h] {
6    puts $fname
7    set f [open $fname]
8    set g [open foobar w]
9    while {! [eof $f]} {
10	gets $f line
11	puts $g $line
12    }
13    close $f
14    close $g
15    file delete -force $fname
16    file rename foobar $fname
17}
18