File: fix-script.tcl

package info (click to toggle)
nam 1.15-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 29,240 kB
  • sloc: cpp: 17,338; tcl: 10,655; sh: 2,997; ansic: 1,252; makefile: 139; perl: 66
file content (25 lines) | stat: -rwxr-xr-x 551 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/local/bin/tclsh7.6

set filename [lindex $argv 0]

if {$filename==""} {
    puts stderr "Usage: fix-script filename"
}

set file [open $filename "r"]

while {[eof $file]==0} {
    set line [gets $file]
    set op [lindex $line 0]
    if {$op!="v"} {
	set time [lindex $line 1]
	set src [lindex $line 2]
	set dst [lindex $line 3]
	set size [lindex $line 4]
	set attr [lindex $line 5]
	set ptype [lindex $line 6]
	set conv [lindex $line 7]
	set id [lindex $line 8]
	puts "$op -t$time -e$size -s$src -d$dst -a$attr -c$conv -p$ptype -i$id"
    }
}