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

Re: ash vs. bash



> [...]
> system() instructions fork /bin/sh). Programs that expect system(3) to
> use a real bourne shell may fail if /bin/sh links to bash. Netscape is
> one of those, as it starts external players with "sh -c ((player %s); rm %s)"
> and the '((' chunk triggers bash's arithmetical expansion code, instead.

Huh??

$ bash -c "((echo hello); echo goodbye)"
hello
goodbye
$ 

In bash, either $((...)) or ((...)) is used for arithmetic expansion.
In the case in point, the fact that the closing parentheses are not
immediately adjacent prevents bash from treating this as an arithmetic
expression.

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
        Debian GNU/Linux Developer,  see http://www.debian.org/~jdg


Reply to: