All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Chazelas <stephane@chazelas.org>
To: Dan Jacobson <jidanni@jidanni.org>
Cc: dash@vger.kernel.org
Subject: Re: Closing parenthesis doesn't raise error in backticked command substitution
Date: Mon, 30 Mar 2026 21:35:02 +0100	[thread overview]
Message-ID: <acrdeiP1S6QkTz7S@chazelas.org> (raw)
In-Reply-To: <871ph1h8p1.3.fsf@jidanni.org>

2026-03-30 19:12:58 +0800, Dan Jacobson:
> Please see https://unix.stackexchange.com/questions/805208
> 
> $ ls -og /bin/sh
> lrwxrwxrwx 1 4 2025-02-04  /bin/sh -> dash
> $ m=`seq 1 2 3)`
> 
> Since when is it "OK" to have a trailing ) after the 3?
> 
> $ n=$(seq 4 5 6))
> sh: 2: Syntax error: ")" unexpected
> 
> That's better. (But what is 2? No, it's not line 2 since I started the shell.)
> 
> Package: dash                            
> Version: 0.5.12-12

For the record, that same "bug" in NetBSD sh on which dash I
beleive is initially based on was fixed in
https://github.com/NetBSD/src/commit/fbbbd4fe8c79ac320acd6cc1e6405efa509710b6
in 2008.

https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=11317

-- 
Stephane

      reply	other threads:[~2026-03-30 20:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 11:12 Closing parenthesis doesn't raise error in backticked command substitution Dan Jacobson
2026-03-30 20:35 ` Stephane Chazelas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acrdeiP1S6QkTz7S@chazelas.org \
    --to=stephane@chazelas.org \
    --cc=dash@vger.kernel.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.