[Techtalk] Bash builtin "read" isn't working like I expect

Megan Golding mgolding at sdf.lonestar.org
Thu Oct 30 21:00:43 EST 2003


On Thu, Oct 30, 2003 at 12:06:32PM -0600, Elizabeth Barham wrote:
> Here are my two files that I'm using
> as a test case:
> client.txt 
> ~~~~~~~~~~
> domain.com
> bank.com
> sample.org
> 
> master.csv
> ~~~~~~~~~~
> domain.com,domain,com
> bank.com,bank,com
> sample.org,sample,org
> 
> This looks good to me:
> 
> ~$ while read LINE; do echo $LINE; grep "$LINE" master.csv; done < client.txt
> domain.com
> domain.com,domain,com
> bank.com
> bank.com,bank,com
> sample.org
> sample.org,sample,org

Hrm. That's *not* the response I get. Dominik suggested I look into line termination characters like \n. Since it works properly for you, I'll mess around with it from my end.

Thanks Dominik and Elizabeth for the suggestions. I fixed 2 gotchas based on your help.

LinuxChix rocks!

Meg

-- 
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 mailing list