From owner-freebsd-questions@FreeBSD.ORG Mon Sep 25 15:58:46 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBDED16A416 for ; Mon, 25 Sep 2006 15:58:46 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1875D43D70 for ; Mon, 25 Sep 2006 15:58:40 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.6) id k8PFwero013905; Mon, 25 Sep 2006 10:58:40 -0500 (CDT) (envelope-from dan) Date: Mon, 25 Sep 2006 10:58:39 -0500 From: Dan Nelson To: Arindam Message-ID: <20060925155839.GF73717@dan.emsphone.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 6.1-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-questions@freebsd.org Subject: Re: Korn Shell [[ ... ]] operator 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, 25 Sep 2006 15:58:46 -0000 In the last episode (Sep 25), Arindam said: > I know csh is the shell of choice on FreeBSD. But I have this question > on Korn Shell and it would be great if somebody could explain. > > Can someone tell me a little more about the Korn Shell [[ ... ]] > double-brackets construct used for comparing string expressions. How > does it differe from the standard [ ... ] single brackets. Different comparison operators, basically, and faster than [ because it doesn't have to fork /bin/[ . > You could tell me to RTFM but I haven't gleaned enough clarity from > such efforts already expended. They're all documented in the manpage ("ksh93" for the shells/ksh93 ports), under Conditional Expressions. Compare them with the "test" manpage. It looks like FreeBSD's test command does most of what ksh does, except for the wildcard matching of =, which is handy but can be emulated with a case statement :) -- Dan Nelson dnelson@allantgroup.com