bash: Word splitting but when?

Brian Dessent
Wed Oct 22 14:16:00 GMT 2008 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


       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.


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list