bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconsistent field splitting


From: Marc Herbert
Subject: Re: inconsistent field splitting
Date: Thu, 19 Aug 2010 10:32:12 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1

Since inconsistency is basically "not the same rule
everywhere", it typically shows in (good) documentation. Indeed:

  
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06
  2.6 Word Expansions
  Not all expansions are performed on every word, as explained in the
  following sections.

The above sentence leaves open the scary possibility of a large number
of combinations and special cases, but of course it is not that badly
inconsistent.

Focusing back on field splitting, both the opengroup and the (similar)
bash manual have the same documentation logic: they apparently never
explicit where field splitting is performed (only before/after which
expansions it is performed when it is).

So to understand where field splitting is performed the reader must
assume that it is performed everywhere, except when it is exceptionally
missing from an exhaustive list of expansions ("case", assignment,...).
Unclear and inconvenient.

Of course the best alternative is the one mentioned by Greg: assume
that field splitting is consistently performed everywhere and keep
quoting everything all the time. It is a good habit anyway and
avoids bugs due to refactoring.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]