From owner-freebsd-questions@FreeBSD.ORG Mon Jun 21 12:13:41 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 21007106566B for ; Mon, 21 Jun 2010 12:13:41 +0000 (UTC) (envelope-from faust64@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id A20E58FC20 for ; Mon, 21 Jun 2010 12:13:40 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so661616fga.13 for ; Mon, 21 Jun 2010 05:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=sjMBrv9zI5rqG1my1pQI60X/zGkGqwjmSTr/CouwbIo=; b=voB1Y00slTfpgir4a/Z8rJchYrINqV4ABJsRZ9AYdUJdZjVFhHC1QmPJZHAV5KZsVY 0F1vJM4P+aC8X/wWmnrp9Qgz2h2ENBkjeR7wlhoSBBXlVcAvNzwlYxr0Bl+Vc5d4VacA XWE5V/cerTBg5L/sQZqL1rOI9erSBzxqd4LO0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=khEH9iY6S9ziYTYTsY5+dc/6KUZYkGO6brb0MFCOq0cy8bB4copKr7ClMSq5N0S4vC ZBId1XBYbl6+hWaZNEx6WAbpQF5aNxxwS9g3T8rp/sHQXIm7Zmk7nfiaISrxg9WVbjhx NcogkBgEs2PhAr618fiXTOi44cUAJeXbJKoPM= Received: by 10.204.136.87 with SMTP id q23mr2864794bkt.161.1277122419324; Mon, 21 Jun 2010 05:13:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.50.202 with HTTP; Mon, 21 Jun 2010 05:13:09 -0700 (PDT) In-Reply-To: <4C1F4B4C.2000006@comclark.com> References: <4C1F4B4C.2000006@comclark.com> From: =?ISO-8859-1?Q?Samuel_Mart=EDn_Moro?= Date: Mon, 21 Jun 2010 14:13:09 +0200 Message-ID: To: Aiza Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 12:13:41 -0000 it seems to work your main error is to use ${found_name} instead of ${name}. also, you do not set ${group} in your example. and, not essential, but test -z before adding useless spaces. correcting that, I had it working perfectly. h2g2:~# cat test path=3D/dev group=3Dtty for name in "${path}/${group}"* do [ -z "${found_list}" ] && found_list=3D"${name}" || found_list=3D"${found_list} ${name}" done echo "found list: $found_list" h2g2:~# sh test found list: /dev/ttyU0 /dev/ttyU0.init /dev/ttyU0.lock /dev/ttyd0 /dev/ttyd0.init /dev/ttyd0.lock /dev/ttyp0 /dev/ttyp1 /dev/ttyp2 /dev/ttyp3 /dev/ttyp4 /dev/ttyp5 /dev/ttyp6 /dev/ttyp7 /dev/ttyv0 /dev/ttyv1 /dev/ttyv= 2 /dev/ttyv3 /dev/ttyv4 /dev/ttyv5 /dev/ttyv6 /dev/ttyv7 /dev/ttyv8 /dev/ttyv= 9 /dev/ttyva /dev/ttyvb /dev/ttyvc /dev/ttyvd /dev/ttyve /dev/ttyvf h2g2:~# Samuel Mart=EDn Moro {EPITECH.} tek4 CamTrace S.A.S (+033) 1 41 38 37 60 1 All=E9e de la Venelle 92150 Suresnes FRANCE "Nobody wants to say how this works. Maybe nobody knows ..." Xorg.conf(5) On Mon, Jun 21, 2010 at 1:21 PM, Aiza wrote: > for name in "${path}/${group}"*; do > found_list=3D"${found_list} ${found_name}" > done >