davedoom wrote:
> I am trying to learn to write recursive functions in bash. As one of my
> first attempts i wrote this program to emulate the system provided tac
> command:
>
> after playing with it for a good bit, it no longer produces this error
> message:
> malloc: ../bash/subst.c:4135: assertion botched
> realloc: start and end chunk sizes differ
>
> but it doesn't reverse the file. What am i doing wrong? Is there
> something about unix file descriptors I don't understand?
I can't reproduce the malloc error, but this will never work. You're
passing a pipe named in /dev/fd to a function that expects to use the
data multiple times. The first call to `wc' consumes the entire stream.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU [EMAIL PROTECTED] http://cnswww.cns.cwru.edu/~chet/