# expect script to change first line of script to reflect new binary

# Synopsis: expect fixline1 newbinary < input > output
# Author: Don Libes

set newbinary [lindex $argv 1]

gets stdin buf

if 0==[string first #! $buf] {
	puts stdout "#!$newbinary [lrange [split $buf " "] 1 end]"
} else {
	puts stdout $buf
}

while {-1!=[gets stdin buf]} {
	puts stdout $buf
}
