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).
--
dhs spencer@[EMAIL PROTECTED]


|