From owner-freebsd-questions@FreeBSD.ORG Tue Jun 1 03:22:04 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 8C88E1065672 for ; Tue, 1 Jun 2010 03:22:04 +0000 (UTC) (envelope-from sahil@tandon.net) Received: from spartan.hamla.org (spartan.hamla.org [206.251.255.30]) by mx1.freebsd.org (Postfix) with ESMTP id 6867C8FC19 for ; Tue, 1 Jun 2010 03:22:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spartan.hamla.org (Postfix) with ESMTP id 16E2F1711A for ; Mon, 31 May 2010 23:22:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tandon.net; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:reply-to:message-id :subject:subject:from:from:date:date:received:received; s=aegis; t=1275362523; bh=/3CCvEQJQYj0BKHnA0kUhAekkofz/2xjW/gLQv7WkSA=; b= KN1wjmgFrnRybQhVDF5Ebq9vSgr1nT7IPHXgxqXnKfEMbXKkrTE49czzafOmXT0e pQkG8pmWGyYneBImrIoNuDgIgr8vA93KNBO476GjKz2JU8HBQqMg44SL4oS5gnME oZzMZn4LNfm0I7zVINnx54jdgmc44ksJ9LwdX207X/g= X-Virus-Scanned: by ClamAV at spartan.hamla.org Received: from spartan.hamla.org ([127.0.0.1]) by localhost (spartan.hamla.org [127.0.0.1]) (amavisd-new, port 10027) with LMTP id idbdIeviEt82 for ; Mon, 31 May 2010 23:22:03 -0400 (EDT) Received: from magic.hamla.org (cpe-69-201-179-80.nyc.res.rr.com [69.201.179.80]) by spartan.hamla.org (Postfix) with ESMTPSA id 9FD6A17042 for ; Mon, 31 May 2010 23:22:03 -0400 (EDT) Date: Mon, 31 May 2010 23:22:01 -0400 From: Sahil Tandon To: freebsd-questions@freebsd.org Message-ID: <20100601032201.GA1333@magic.hamla.org> References: <4C046937.2030905@comclark.com> <4C047761.2040403@comclark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C047761.2040403@comclark.com> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: unexpected operator .sh error X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sahil Tandon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 03:22:04 -0000 On Tue, 01 Jun 2010, Aiza wrote: > Chris Hill wrote: > >The open-square-bracket, [, is another name for test. IIRC the > >equal sign is not valid in that context. Using '=' within test(1) brackets should be fine. > >Can you post the 'before' and 'after' versions of that part of > >your script? It would help us in determining what the problem is. > > That hint got me to the correct line > > I had if [$1 = "basejail" ]; then As noted by Chris and the sh(1) man page, '[' is a built-in equivalent of test(1). The correct syntax for an expression inside those brackets requires *spacing*, i.e. [ expression ], and not [expression ], as in your example. -- Sahil Tandon