Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2007 11:10:02 -0500
From:      "Dak Ghatikachalam" <dghatikachalam@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Korn shell script Question
Message-ID:  <ba29b9b40702020810v6e371cb3i92a3504c6285b790@mail.gmail.com>
In-Reply-To: <20070131202202.GB49580@fw.home>
References:  <ba29b9b40701311043u74a60268y390c32b5579fdd1d@mail.gmail.com> <20070131190658.GA49580@fw.home> <ba29b9b40701311127q1600c115k5eb0f69da0733ef6@mail.gmail.com> <20070131202202.GB49580@fw.home>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/31/07, kris <bsdaemon@comcast.net> wrote:
>
> On Wed, Jan 31, 2007 at 02:27:24PM -0500, Dak Ghatikachalam wrote:
> >Thanks a lot , I test ran it. This is great
>
> No problem. I should add that if this is to be part of a long running
> script, you should close the co-process (the while-loop running cat),
> with something like:
>
> exec 5<&p
> exec 5<&-
> _______________________________________________
>

Kris, Thanks  again

I got that right after more digging in man ksh and baby trying for a long
night.

My code worked well after putting like  you said, which I did not understand
initially, but now it is clear.

the code turned out something like


{ while cat /tmp/availspace.$$; do false; done } |&
exec 5<&p
cat  /tmp/reprocesses.$$|awk '/DATAFILE/ { print $0 }'|tr -d ' '|
while read file_b
do
        read -u5 file_a
        echo $file_b $file_a
done >/tmp/reprocessrecset.$$

exec 5<&-

this what you meant ?


Thanks
Dak



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