From owner-freebsd-questions@FreeBSD.ORG Tue Jun 22 01:03:14 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48C57106564A for ; Tue, 22 Jun 2010 01:03:14 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id C6BE68FC1A for ; Tue, 22 Jun 2010 01:03:13 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so824503fgb.13 for ; Mon, 21 Jun 2010 18:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=ZfvjCuWZkJTE5VtSA8ua9pQ4Oeg4JGRuiF6JScI4RL8=; b=fI65r0zkcqoHgsVYdE/dBgS0K8mDe7aL/QjTvTWk+F22UMjnu3FdUBaZcDfPTvZPnF wVSqHnVa0Bz6BPg3XOEayTg4fLbSu38maAbfSv3RhZzjbBKo8gLmSIyWWzOtJSb6iRP7 emkM7X5GJWwEYy7SLPvIUMxoU95SQ09oUpd5M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=Vh0GXXu0rwdvaII1qbvpuX/uNM02F40xL+6A1AxFGRZVtMEAAuoASD1vn6NCdicBWT 07v6HG78Bms17qlHmVnwwp/S5O0sY4jGTzScZTgYqc88f77YrlDu6msyemLSaqHIxLeW win/TWdHXF7B0ekrm+Wxnt5MWVLNTJfJxtR4Q= Received: by 10.87.5.30 with SMTP id h30mr9370208fgi.3.1277168592419; Mon, 21 Jun 2010 18:03:12 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id l12sm7511883fgb.2.2010.06.21.18.03.10 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 18:03:11 -0700 (PDT) Date: Tue, 22 Jun 2010 02:03:08 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20100622020308.5615337c@gumby.homeunix.com> In-Reply-To: <4C1FF3A0.7010902@comclark.com> References: <4C1F4B4C.2000006@comclark.com> <4C1F6746.4050400@comclark.com> <4C1FF3A0.7010902@comclark.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Tue, 22 Jun 2010 01:03:14 -0000 On Tue, 22 Jun 2010 07:20:00 +0800 Aiza wrote: > > test "$name" = "${path}/${group}*" && continue > > [ -z "${found_list}" ] && found_list="${name}" || > I had not known about the 'test' command. > You have taught me something new. In case you're not aware, [ -z "${found_list}" ] is also using test. /bin/test and /bin/[ are hard-linked. So the following are the same: test "$name" = "${path}/${group}*" && continue [ "$name" = "${path}/${group}*" ] && continue