From owner-freebsd-questions@FreeBSD.ORG Tue Jun 1 03:27:24 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 A9EA6106567F for ; Tue, 1 Jun 2010 03:27:24 +0000 (UTC) (envelope-from corky1951@comcast.net) Received: from qmta09.westchester.pa.mail.comcast.net (qmta09.westchester.pa.mail.comcast.net [76.96.62.96]) by mx1.freebsd.org (Postfix) with ESMTP id 306F08FC1A for ; Tue, 1 Jun 2010 03:27:23 +0000 (UTC) Received: from omta06.westchester.pa.mail.comcast.net ([76.96.62.51]) by qmta09.westchester.pa.mail.comcast.net with comcast id QT1a1e00216LCl059TTQbo; Tue, 01 Jun 2010 03:27:24 +0000 Received: from comcast.net ([98.203.142.76]) by omta06.westchester.pa.mail.comcast.net with comcast id QTTM1e0051f6R9u3STTNhf; Tue, 01 Jun 2010 03:27:23 +0000 Received: by comcast.net (sSMTP sendmail emulation); Mon, 31 May 2010 20:27:20 -0700 Date: Mon, 31 May 2010 20:27:19 -0700 From: Charlie Kester To: freebsd-questions@freebsd.org Message-ID: <20100601032719.GR216@comcast.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <4C046937.2030905@comclark.com> <4C047761.2040403@comclark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <4C047761.2040403@comclark.com> X-Mailer: Mutt 1.5.20 X-Composer: Vim 7.2 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 03:27:24 -0000 On Mon 31 May 2010 at 19:58:41 PDT Aiza wrote: >Chris Hill wrote: >>On Tue, 1 Jun 2010, Aiza wrote: >> >>>Added some code to a .sh script. >>>When I run the script works but issues this message >>>[: =: unexpected operator >>> >>>No line number telling where to look. >>>I am not ever sure its talking about. >>> >>>IS [: whats wrong or =: >> >>I'd guess that what you added includes something like >> if [ x=y ] >> ... >> >>The open-square-bracket, [, is another name for test. IIRC the >>equal sign is not valid in that context. >> >>Can you post the 'before' and 'after' versions of that part of your >>script? It would help us in determining what the problem is. >> >>-- >>Chris Hill chris@monochrome.org > > >That hint got me to the correct line > >I had if [$1 = "basejail" ]; then You need a space after the opening [ or it doesn't parse correctly. As Chris said, it's another name for test, so think of it as a word, i.e., something delimited by whitespace.