In article <fodebg$c4t$1@[EMAIL PROTECTED]
>,
David Spencer <spencer@[EMAIL PROTECTED]
> wrote:
> Robert Peirce <bob@[EMAIL PROTECTED]
> writes:
>
> >In sh and ksh, I have used
>
> > for i in `cat file`
> > do
> > do-something-with-$i
> > done
>
> >on other systems with no problem. In OS X, this sometimes hangs, but
> >sometimes it doesn't, which is very confusing. Pr also hangs, but for
> >some strange reason, head works in the same script!
>
> Reading the whole file into one line exceeds the shell's line length
> limit.
>
> It works on other systems because they have longer line-length limits.
> It's still a bad idea.
>
> head(1) works because it's not reading the whole file.
>
> The ksh(1) input mechanism is the read builtin, not cat(1). RTFM
> ksh(1).
I am familiar with read and I have used it in more recent scripts. This
is an old one I thought would work and it didn't. As a stopgap, I used
split to break it into smaller files that I could read with cat until I
get around to using read.
--
Robert B. Peirce, Venetia, PA 724-941-6883
bob AT peirce-family.com [Mac]
rbp AT cooksonpeirce.com [Office]


|