Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Linda Walsh Newsgroups: gnu.bash.bug Subject: Re: read and env variables + POSIX => SEGFAULT Date: Sun, 11 Oct 2015 14:50:15 -0700 Lines: 33 Approved: bug-bash@gnu.org Message-ID: References: <5619D0F1.6080904@tlinx.org> <20151011105924.GA74682@MacGeir> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1444600249 14113 208.118.235.17 (11 Oct 2015 21:50:49 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Geir Hauge Envelope-to: bug-bash@gnu.org User-Agent: Thunderbird In-Reply-To: <20151011105924.GA74682@MacGeir> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 173.164.175.65 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11620 Geir Hauge wrote: > On Sat, Oct 10, 2015 at 08:01:05PM -0700, Linda Walsh wrote: >> # this is odd: 2vars with content for 2: >>> unset a b >>> a= b= read a b <<< x y >>> declare -p a b >> declare -- a="x" >> declare -- b="" >> >> # -- where did "y" go? > > read a b <<< x y > is the same as > read a b y <<< x > > If you escape the space, to make it literal instead of syntactical, you'll get > the expected result: > > $ a= b= read a b <<< x\ y > $ declare -p a b > declare -- a="x" > declare -- b="y" --- Was sorta meant as a rhetorical Question in the batch of examples that seem to have differing behavior -- but especially in contrast with the POSIX versions that dump core. Bad-syntax shouldn't yield Segmentation Violations...