Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jul 2002 10:27:34 -0500
From:      Bob Willcox <bob@immure.com>
To:        questions list <freebsd-questions@freebsd.org>
Subject:   Re: awk getline question/odditiy -- nevermind  :-)
Message-ID:  <20020702152734.GA99249@luke.immure.com>
In-Reply-To: <20020702060553.GA72170@luke.immure.com>
References:  <20020702060553.GA72170@luke.immure.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I have discovered the answer. I had failed to "close" the command after
the while loop. Adding a close function to my little example program
like this fixes the problem:

#!/usr/bin/awk -f
{
        while ($0 | getline line > 0)
                print line
        close($0)
}

Thanks,
Bob


-- 
Bob Willcox          Vital papers will demonstrate their vitality by
bob@vieo.com         spontaneously moving from where you left them to where
Austin, TX           you can't find them.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020702152734.GA99249>