My input looks like
user password
user1 password1
my question is how do I make password be set to the password and not
to password\r ??
Any help is appretiated.
hmmmm, gets should strip the newline automatically, is that
tthe actual, complete code? does the translation for
the channel ever get set explicitly?
anyway, [string trim $str] will remove all extra whitespace
from each end of a string (se also string trimleft,
string trimright)
Bruce
The password should not contain any trailing cf or lf characters. From
the [gets] man page:
This command reads the next line from channelId, returns everything
in the line up to (but not including) the end-of-line character(s),
and discards the end-of-line character(s).
If you have a text file with "crlf" terminated lines, and only the lf is
discarded, you might want to read up on [fconfigure -translation] to
have tcl recognize the end-of-line characters for you. see
http://wiki.tcl.tk/fconfigure
If you're coming from perl, you may not realize that the tcl [puts]
appends a trailing newline for you.
--
Glenn Jackman
gle...@ncf.ca