Re: "for" and line by line

From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 10/29/04


Date: Fri, 29 Oct 2004 07:26:47 -0500


Markus Wenke wrote:

> Hi,
>
> I want to write a "for"-loop in bash such like this one:
>
> for LINE in `cat /etc/passwd`; do
> echo $LINE
> done
>
> But I get every word, and not every line. and if I set "IFS=^M" like this:

See question 16 in the FAQ: http://home.comcast.net/~j.p.h/cus-faq.html#P

        Ed.