From owner-freebsd-questions@FreeBSD.ORG Mon Jun 21 11:21:50 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F06FE106566B for ; Mon, 21 Jun 2010 11:21:50 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp3.comclark.com (avmxsmtp3.comclark.com [202.69.191.117]) by mx1.freebsd.org (Postfix) with ESMTP id 78BE28FC15 for ; Mon, 21 Jun 2010 11:21:50 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkMWAK/oHkzKRa1mPGdsb2JhbAAHh2iXKQEBAQE1J8EohRsEg1I X-IronPort-AV: E=Sophos;i="4.53,453,1272816000"; d="scan'208";a="4675334" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.102]) by avmxsmtp2.comclark.com with ESMTP; 21 Jun 2010 19:21:47 +0800 Message-ID: <4C1F4B4C.2000006@comclark.com> Date: Mon, 21 Jun 2010 19:21:48 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: "questions@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: .sh for loop 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: Mon, 21 Jun 2010 11:21:51 -0000 In a script I have this code path="/usr/namelist" for name in "${path}/${group}"*; do found_list="${found_list} ${found_name}" done The "done" starts another loop. How do I code to know when the "for" has completed. I want to echo "results of for = ${found_list}" to see the accumulated contents. If I put the echo after the "done" I see it for each loop.