File: config.tcl

package info (click to toggle)
tkchooser 2.0652-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 432 kB
  • ctags: 272
  • sloc: tcl: 3,344; makefile: 76; sh: 13
file content (21 lines) | stat: -rwxr-xr-x 427 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# the next line restarts using tclsh \
                exec tclsh "$0" "$@"

#!/usr/local/bin/tclsh

if {$argc != 3} {
    puts "usage: config.tcl infile outfile newpath"
    exit
}

set fd1 [open "[lindex $argv 0]" r]
set fd2 [open "[lindex $argv 1]" w]
set newpath "[lindex $argv 2]"

set sub "\\1\"$newpath\""

while {[gets $fd1 line] != -1} {
    regsub {^(set libdir )(.*)} $line $sub line
    puts $fd2 $line
}