Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

very simple question in tcl

Status
Not open for further replies.

ee1

Programmer
May 31, 2011
25
0
0
IL
Hi i am writing a simple script,
all i want to to is read a file and print its lines.

the script:

#!/bin/csh
set fid [open my_file.dat r+]
while {![eof $fid]} {
set line [gets $fid]
puts $fid
}
close $fid

and when i run :
source my_script.tcl
i am getting:
"set: Variable name must begin with a letter."

what am i doing wrong?...
thanks.
 
you have:
puts $fid

but I think you want:
puts $fid $line

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top