git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff King <peff@peff.net>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
	"Git List" <git@vger.kernel.org>
Subject: Re: [PATCH] t0300: workaround bug in FreeBSD < 10 sh
Date: Thu, 14 May 2020 18:44:42 -0400	[thread overview]
Message-ID: <CAPig+cTEO--BCE_hMsWNowx7R9pP-oag2_ugEPDTPAizqOMDsQ@mail.gmail.com> (raw)
In-Reply-To: <20200514220346.GA3074610@coredump.intra.peff.net>

On Thu, May 14, 2020 at 6:03 PM Jeff King <peff@peff.net> wrote:
> Just to be clear, if you run:
>
> foo() {
>   for i in "$@"; do
>     echo "arg:$i"
>   done
>   sed s/^/stdin:/
> }
> set -- outer
> foo inner <<EOF
> $1
> EOF
>
> do you get:
>
> arg:inner
> stdin:inner

That is indeed the result with the FreeBSD 9.3 shell. Seems buggy.
Assigning $1, $2, ... to variables (local or not) as Carlo's patch
does seems to work around the buggy behavior.

  reply	other threads:[~2020-05-14 22:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 21:05 [PATCH] t0300: workaround bug in FreeBSD < 10 sh Carlo Marcelo Arenas Belón
2020-05-14 22:03 ` Jeff King
2020-05-14 22:44   ` Eric Sunshine [this message]
2020-05-14 23:30   ` Carlo Marcelo Arenas Belón
2020-05-14 22:55 ` brian m. carlson
2020-05-14 23:04   ` Junio C Hamano
2020-05-14 23:43     ` Carlo Marcelo Arenas Belón

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=CAPig+cTEO--BCE_hMsWNowx7R9pP-oag2_ugEPDTPAizqOMDsQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).