From owner-freebsd-questions@FreeBSD.ORG Fri Mar 13 05:35:33 2009 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 900511065670 for ; Fri, 13 Mar 2009 05:35:33 +0000 (UTC) (envelope-from bf2006a@yahoo.com) Received: from web39104.mail.mud.yahoo.com (web39104.mail.mud.yahoo.com [209.191.87.32]) by mx1.freebsd.org (Postfix) with SMTP id 544B68FC23 for ; Fri, 13 Mar 2009 05:35:33 +0000 (UTC) (envelope-from bf2006a@yahoo.com) Received: (qmail 30561 invoked by uid 60001); 13 Mar 2009 05:35:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1236922532; bh=QqRmCB6/piXqCPdOftSThhevAWTQntGVY3ogex5DLSg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=xAsucfYtphQeLnd1OKW1eVQZ5HeGPqbDjkbZPO3zR2dRAzQE6cYjlgOVGdWJZ5ZgNnZNOJ3pBqeQMGKVq7umFC6VFpkNSGPlrsa7KLeMlFX6iQ+DQO1grhKPxujkJToGEKgS3+mSh3L/5pCiYvzM8zJuMtFtcYXCZqClgxSmjsM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=efkRDxvdejeVjAkPkIe078AO6ZMeuUSIZLhg+B4cDDFv9o0xMmRaLUM8p9vTEAzochn9n/uUCsPwkj2Lxc5nsf9mmagFoPIjBIvXJ03hJp8bG86Lt0549I1g8Fr6djCqWp1Q54u6z4ir+YZeKwHaZ7l02CE7WcNqCh3iyITmn30=; Message-ID: <721111.30542.qm@web39104.mail.mud.yahoo.com> X-YMail-OSG: nv52rFIVM1kya24R0VdLMFY1wCCaaP1PNlpyM9fc0MSoLbD7tChTZCt.swn5zfTQ0K1wyqyEQH.zoR7H1VX6z4HRDbT.Jkp_552XBpNEGbJtksOZXy36gOH6CJ3uNixD12NOsTmzlYI6QhdEV0l.VsHWqN3awXyShfPcZf2bxP7y96SX_A3XknanlVeeIcTTFnyW9s105TGn2gcrh6wc46mmWWL2Rg-- Received: from [79.134.170.65] by web39104.mail.mud.yahoo.com via HTTP; Thu, 12 Mar 2009 22:35:32 PDT X-Mailer: YahooMailWebService/0.7.289.1 Date: Thu, 12 Mar 2009 22:35:32 -0700 (PDT) From: bf To: freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: Re: Problem with Bash-4 and $(command) syntax X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf2006a@yahoo.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2009 05:35:33 -0000 > > {Problem with Bash-4 and $(command) ...}: > [...] > > I found the same problem, and have reverted to > > bash3.2 until it's sorted out. > > See if the following helps. > > http://tiswww.case.edu/php/chet/bash/COMPAT > > Especially: > > 38. Since bash-4.0 now follows Posix rules for finding the > closing > delimiter of a $() command substitution, it will not behave as > previous > versions did, but will catch more syntax and parsing errors > before > spawning a subshell to evaluate the command substitution. > > -- >Eray Yes, the above is true. But many of the examples cited by people noticing this problem are perfectly valid and _should_ work. The problem is that the port's parser is broken, owing in part to incompatibilities between the system yacc currently used to build the parser and GNU bison, which is used by the people who write bash. This is true of both shells/bash and shells/bash3, but is more noticeable in shells/bash. A fix has been proposed, and patches are available, in the follow-up to: http://www.FreeBSD.org/cgi/query-pr.cgi?pr=ports/101230 The port's maintainer has been reluctant to switch to bison, so this may not be the solution that is ultimately used to fix the port, but you can use these in the meantime. Regards, b.