Horinius <[EMAIL PROTECTED]> wrote: > Is there any pitfall using this solution of yours? You talked about > "regular file", what's that supposed to be? Text file vs binary file?
No, just that it doesn't work for pipes, so the data you're reading has to be in a named file, not produced as the output of another program. But even in that case, you could do it like this: while read line; do ...; done <<EOT $(data-producer-command) EOT That will also ensure that the last line ends with a newline, but the $() command substitution will also remove any trailing empty lines, which might be a problem, depending on what you're doing. paul