I have a question about gets
I have a tcl script to search through SMAT files
I use this code :
set f [ open filename ]
while { 1 } {
set rc [ gets $f rec ]
if { $rc< 0 } {break } puts $rec } close $f
It works fine
then I decided to use the same script to read input not from the file
but from the pipe
cat filename | myscript
My code in this case :
while { 1 } {
set rc [ gets stdin rec ]
if { $rc< 0 } {break }
puts $rec
}
I noticed in this case gets
which is not the case when it reads from file
Is it a way to control this behavior and disable this convertion?
Thanks