[Techtalk] Bash builtin "read" isn't working like I expect
mgolding at sdf.lonestar.org
Thu Oct 30 15:39:57 EST 2003
I'm trying to get the Bash command "read" to give me lines from a file:
while read LINE; do echo $LINE; grep $LINE $other-file; done < $first-file
The line from $first-file is echoed back from within the do loop (the echo $LINE bit), so I know the main construct is working (that is, the while loop is going through every line in $first-file).
Yet, when the grep part runs, STDOUT gets no matching lines between $LINE and $other-file. But I know there are matches.
Here are sample file contents -->
I don't know "read" well enough to know why it's acting funky. Googleing turned up bugs in bash itself and some confusing mentions of the IFS variable. I would really appreciate any help. Or general ideas.
Life with Rachel, one mom's journey: http://www.kalamitykat.com
AIM: meganau Yahoo!: meggolding email: mgolding at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
More information about the Techtalk