Re: [PATCH] t0300: workaround bug in FreeBSD < 10 sh
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 14, 2020, 22:44 UTC
- Message-ID
- <CAPig+cTEO--BCE_hMsWNowx7R9pP-oag2_ugEPDTPAizqOMDsQ@mail.gmail.com>
- In-Reply-To
- <20200514220346.GA3074610@coredump.intra.peff.net>
On Thu, May 14, 2020 at 6:03 PM Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> 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:innerThat 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.