From owner-freebsd-questions@FreeBSD.ORG Fri Feb 2 16:10:03 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC6C216A403 for ; Fri, 2 Feb 2007 16:10:03 +0000 (UTC) (envelope-from dghatikachalam@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) by mx1.freebsd.org (Postfix) with ESMTP id 47B6E13C474 for ; Fri, 2 Feb 2007 16:10:03 +0000 (UTC) (envelope-from dghatikachalam@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so906887wxc for ; Fri, 02 Feb 2007 08:10:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TWiUKjoFKT218Sm2CmUl2dtYsXKWzhlHcs+ytAMxXSXFeaXWBf1RweBiyjoX4GdUy13fRDXWTqe0JPtRNdh3uFX41CT7rma9C8tDzkYq+YneOOpwGt6ylQuirdXAqarLoJ7qGMjfOzHF8UidUYyMHzKNZS91M+acqbUxAxzNNX8= Received: by 10.70.38.12 with SMTP id l12mr6404685wxl.1170432602689; Fri, 02 Feb 2007 08:10:02 -0800 (PST) Received: by 10.70.52.12 with HTTP; Fri, 2 Feb 2007 08:10:02 -0800 (PST) Message-ID: Date: Fri, 2 Feb 2007 11:10:02 -0500 From: "Dak Ghatikachalam" To: freebsd-questions@freebsd.org In-Reply-To: <20070131202202.GB49580@fw.home> MIME-Version: 1.0 References: <20070131190658.GA49580@fw.home> <20070131202202.GB49580@fw.home> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Korn shell script Question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2007 16:10:03 -0000 On 1/31/07, kris 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