X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <48FF353B.529292C2@dessent.net>
Date: Wed, 22 Oct 2008 07:14:19 -0700
From: Brian Dessent <brian@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: bash: Word splitting but when?
References: <1224680840.20653.ezmlm@cygwin.com>  <BAY119-W554558D88293827703F914A9290@phx.gbl> <BAY119-W5412E8E2CD245EBD78B68EA9290@phx.gbl>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

sbremal@hotmail.com wrote:

> the ouput of $(echo '1 2  3   x') should go through word splitting and x
 
Word splitting does not occur in the right-hand side of an assignment. 
From the manual:

       A variable may be assigned to by a statement of the form

              name=[value]

       If value is not given, the variable is assigned the null  string.
       All values undergo tilde expansion, parameter and variable expan-
       sion,  command  substitution,  arithmetic  expansion,  and  quote
       removal  (see  EXPANSION below).  If the variable has its integer
       attribute set, then value is evaluated as an  arithmetic  expres-
       sion  even  if the $((...)) expansion is not used (see Arithmetic
       Expansion below).  Word splitting  is  not  performed,  with  the
       exception  of  "$@"  as explained below under Special Parameters.
       Pathname expansion is not performed.  Assignment  statements  may
       also  appear as arguments to the alias, declare, typeset, export,
       readonly, and local builtin commands.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

