From owner-freebsd-questions@FreeBSD.ORG Wed Jan 3 21:33:02 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16AFE16A415 for ; Wed, 3 Jan 2007 21:33:02 +0000 (UTC) (envelope-from redchin@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.freebsd.org (Postfix) with ESMTP id 7F87713C457 for ; Wed, 3 Jan 2007 21:33:01 +0000 (UTC) (envelope-from redchin@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so7285361nfc for ; Wed, 03 Jan 2007 13:33:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=i8OGSFJW+x6t4B7Bg0oxl+DPZpB8beKexhaZOBUgjFe3ePOVmZzIy3076YufYrp5Kv358Kfcsb0SGUYrhMhBGnv20Abh4zf//YQGROnelf8UXGtZSKknzlkcW+lGdD5eweAwIjAl15FSETo8IItsFOTGY28+27rSGa76yd70PAI= Received: by 10.82.152.16 with SMTP id z16mr1433124bud.1167859980291; Wed, 03 Jan 2007 13:33:00 -0800 (PST) Received: by 10.82.112.7 with HTTP; Wed, 3 Jan 2007 13:32:59 -0800 (PST) Message-ID: <1d3ed48c0701031332p6bfa4a23l9e19d164289dd12@mail.gmail.com> Date: Wed, 3 Jan 2007 13:33:00 -0800 From: "Kevin Downey" To: "Jerry McAllister" In-Reply-To: <20070103211852.GB60153@gizmo.acns.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17820.3343.799303.349686@jerusalem.litteratus.org> <20070103211852.GB60153@gizmo.acns.msu.edu> Cc: Robert Huff , questions@freebsd.org Subject: Re: OT: stupid sh scripting question 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: Wed, 03 Jan 2007 21:33:02 -0000 On 1/3/07, Jerry McAllister wrote: > On Wed, Jan 03, 2007 at 03:07:43PM -0500, Robert Huff wrote: > > > > > This is probably staring me in the face: > > > > if [ ! -d "foo"] > > then mkdir foo > > fi > > > > gives me: > > > > [: missing ] > > It is probably not telling you ':' missing but ';' missing. > It goes after the ']', plus I think the space before ']' is required. > > ////jerry > > > > > Looking at rc.subr I see: > > > > if [ ! -d "$linkdir" ]; then > > warn "$_me: the directory $linkdir does not exist." > > return 1 > > fi > > > > > > Robert Huff > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > the ';' is not required if the 'then' statement is not on the same line as the 'if' statement. kpd@zifnab ~% sh $ if echo foo > then > echo bar > fi foo bar sorry for the repeat jerry (gmail's reply defaults to replying to just the sender and not everyone) -- The biggest problem with communication is the illusion that it has occurred.