Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2013 13:49:21 -0500
From:      Reid Linnemann <linnemannr@gmail.com>
To:        FreeBSD Hackers <hackers@freebsd.org>
Cc:        "<rank1seeker@gmail.com>" <rank1seeker@gmail.com>, Jilles Tjoelker <jilles@stack.nl>
Subject:   Re: /bin/sh => STDIN & functions, var scope messing
Message-ID:  <CA%2B0MdpP6JKMyoQCTDihCRSqHHVDfy1w3ip%2BqWhFgXRqfMYODow@mail.gmail.com>
In-Reply-To: <13CA24D6AB415D428143D44749F57D7201F6AD11@ltcfiswmsgmb21>
References:  <20130527.194235.693.1@DOMY-PC> <CA%2B0MdpOcz7aw03HCrbxZVt1cnWdR4shqWaEfBrQkCpPnbgXLPQ@mail.gmail.com> <CAKw7uVjty2cJXT_QmexxKdRQyiKoHYMK1E-TjSHa5TCX1S8Bbg@mail.gmail.com> <20130530223031.GA1672@stack.nl> <20130531.175959.745.2@DOMY-PC> <13CA24D6AB415D428143D44749F57D7201F6AD11@ltcfiswmsgmb21>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 31, 2013 at 1:12 PM, Teske, Devin <Devin.Teske@fisglobal.com>wr=
ote:

>
> If you're arguing we have to change sh's behavior to be more compliant,
> jilles already quoted XCU 2.12 (our shell is well within its right to run
> any/all lvalue/rvalue operands of a pipe in a sub-shell without
> contradicting the guidelines).
>
> But if you're arguing that it has to change to make things better or
> easier=85 I don't know about that. Might just make people lulled into usi=
ng a
> style that's non-portable. I'd like to keep things the way they are so th=
at
> if you program for FreeBSD, you're inherently going to program in a fashi=
on
> that is more portable.
> --
> Devin
>

FWIW bash (invoked as sh) on RHEL-based linux systems exhibits the same
behavior-

sh-3.2$ var=3D1
sh-3.2$ yes|var=3D2
sh-3.2$ echo $var
1
sh-3.2$

If my opinion matters at all, I would agree that for the sake of
portability that behavior be consistent with the majority of sh
implementations rather than "right" according to arbitrary ruling.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B0MdpP6JKMyoQCTDihCRSqHHVDfy1w3ip%2BqWhFgXRqfMYODow>