[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 6 Sep 2001 12:23:26 -0400
> This is really wierd, but I think I found a bug in bash. Any way I try
> and set IFS to a <newline> it crashes bash. I'm simply trying to iterate
> for each line in a file, so if there's a better way, let me know.
> Nevertheless, this is really strange to me.
> #for each line
> for i in $1; do
> echo $i
This script as written doesn't do at all what you think it does. It just
echos the script arguments, splitting them where they contain `\' or `n'.
If you want to iterate for each line in a file, use `read':
while read line
done < file
How exactly does bash `crash'? Does it core dump?
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)
Chet Ramey, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/
|[Prev in Thread]
||[Next in Thread]|
- Re: (none),
Chet Ramey <=