This is a question regarding file reading in tcl. I am opening a buffer stream to write and i have only one file handler referece to it Now while reading this buffer line by line, at some condition I have to put all the content of the buffer, Please suggest how can i achieve this. So i am just pasting an example code to explain my requirement.
catch { open "| grep" r } pipe
while { [gets $pipe line] } {
if { some_condition } {
## display all the content of $pipe as string
}
}
Thanks Ruchi