From owner-freebsd-questions@FreeBSD.ORG Mon Jun 21 23:20:02 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 2FD201065670 for ; Mon, 21 Jun 2010 23:20:02 +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 B8E578FC12 for ; Mon, 21 Jun 2010 23:20:01 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwUAEOQH0zKRa1mPGdsb2JhbAAHh2iXJAEBAQE1wwKFGwSDUg X-IronPort-AV: E=Sophos;i="4.53,456,1272816000"; d="scan'208";a="4712268" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.102]) by avmxsmtp3.comclark.com with ESMTP; 22 Jun 2010 07:20:00 +0800 Message-ID: <4C1FF3A0.7010902@comclark.com> Date: Tue, 22 Jun 2010 07:20:00 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Samuel_Mart=EDn_Moro?= References: <4C1F4B4C.2000006@comclark.com> <4C1F6746.4050400@comclark.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: "questions@freebsd.org" Subject: Re: .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 23:20:02 -0000 Samuel Martín Moro wrote: > for name in "${path}/${group}"* > do > path=/dev > group=ttypqfr > for name in "${path}/${group}"* > do > test "$name" = "${path}/${group}*" && continue > [ -z "${found_list}" ] && found_list="${name}" || > found_list="${found_list} ${name}" > done > echo "found list: $found_list" > Thank You Samuel. Using the 'test' command solved my problem. I had not known about the 'test' command. You have taught me something new.