bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: AM_ICONV check fails with some shells


From: Bruno Haible
Subject: Re: AM_ICONV check fails with some shells
Date: Wed, 2 Jul 2008 01:18:25 +0200
User-agent: KMail/1.5.4

Timo Sirainen wrote:
> Apparently FreeBSD 7.0R or 6.3R without bash? Coud you answer Yasushi?

and got this reply:

> I use fdsh 3.00a as a login shell.  fdsh can be installed by the
> package name "fdclone" on Debian GNU/Linux or Ubuntu Linux.
> 
> Unfortunately, the top page of this program is only written in
> Japanese.  Some documents are available in English
> 
> http://hp.vector.co.jp/authors/VA012337/soft/fd/fd_e.txt
> http://hp.vector.co.jp/authors/VA012337/soft/fd/README.eng.txt
> http://hp.vector.co.jp/authors/VA012337/soft/fd/FAQ.eng.txt
> http://hp.vector.co.jp/authors/VA012337/soft/fd/Install.eng.txt
> 
> Source code of the program can be downloaded from the below host.
> ftp://ftp.unixusers.net/src/fdclone/

It appears to be a bug in this shell.

POSIX [1], section "Parameter Expansion", says

   "The format for parameter expansion is as follows:
          ${expression}
    where expression consists of all characters until the matching '}'.
    Any '}' escaped by a backslash or within a quoted string, and characters
    in embedded arithmetic expansions, command substitutions, and variable
    expansions, shall not be examined in determining the matching '}'"

   "If a parameter expansion occurs inside double-quotes:
      ...
      - Field splitting shall not be performed on the results of the
        expansion, with the exception of '@' ; see Special Parameters."

Assuming ac_t is not a defined macro,

echo "foo${ac_t:-
        }bar"

must print

foo
        bar

There is no reason for the newline to be treated specially, because
  - The description of "parameter expansion" talks about _all_characters_.
  - Token Recognition (section 2.3 in POSIX) has already occurred: a
    double-quoted string must have been recognized.
  - Field splitting is not performed here, see above.

So it's a bug in that shell. Since it is under active development, I
expect this bug to be fixed in the future.

Bruno


[1] http://www.opengroup.org/susv3/utilities/xcu_chap02.html





reply via email to

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