Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Mar 2009 16:48:44 +0200
From:      "Andrew W. Nosenko" <andrew.w.nosenko@gmail.com>
To:        Johan van Selst <johans@stack.nl>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: shells/bash-4.0 port horribly broken
Message-ID:  <6161f3180903120748h5a9b6b17y2faf779b69819c7@mail.gmail.com>
In-Reply-To: <20090312143710.GA106@mud.stack.nl>
References:  <20090311210322.GA17971@ozzmosis.com> <20090312073556.GA39778@ozzmosis.com> <20090312112958.4d0cac92.ehaupt@FreeBSD.org> <76B7C6A4-B380-4224-AF69-03ABB1CE5175@lassitu.de> <20090312103015.2ee5dbef@scorpio> <20090312143710.GA106@mud.stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 12, 2009 at 4:37 PM, Johan van Selst <johans@stack.nl> wrote:
> Jerry wrote:
>> Was this some sort of 'improvement' by the Bash developers, or is it
>> an un-squashed bug?
>
> It seems that this might actually be a feature.
> Quoting the COMPAT document of bash4:
>
> 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.

Sorry, but I didn't see how it can be applied.  In another words, how
the 'ls' command in the

    $ echo $(ls)

contradicts with POSIX.

http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03

    With the $( command) form, all characters following the open
    parenthesis to the matching closing parenthesis constitute the
    command. Any valid shell script can be used for command,
    except a script consisting solely of redirections which produces
    unspecified results.

Sure, 'ls' is not a something that "consisting solely of redirections".

-- 
Andrew W. Nosenko <andrew.w.nosenko@gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6161f3180903120748h5a9b6b17y2faf779b69819c7>