|
From: Bart V. A. <bar...@gm...> - 2009-02-07 15:05:03
|
Hello, As known Ubuntu uses dash as default shell instead of bash. Since the shell scripts included with Valgrind intentionally use /bin/sh as their interpreter, these scripts do not only have to be POSIX compliant but also have to take the additional dash restrictions into account. An overview of bash and/or POSIX features that are not supported by dash can be found here: https://wiki.ubuntu.com/DashAsBinSh Bart. |
|
From: Tom H. <to...@co...> - 2009-02-07 15:47:07
|
Bart Van Assche wrote: > As known Ubuntu uses dash as default shell instead of bash. Since the > shell scripts included with Valgrind intentionally use /bin/sh as > their interpreter, these scripts do not only have to be POSIX > compliant but also have to take the additional dash restrictions into > account. An overview of bash and/or POSIX features that are not > supported by dash can be found here: Are you really saying that /bin/sh on Ubuntu is not a POSIX compliant bourne shell? That sounds very odd, and it does not appear to be what the web page you referred to says either. What the page says is that /bin/sh is dash, so scripts have to stick to the POSIX /bin/sh command set and not use bash extensions. I'm also not very clear as to the point of your mail as you haven't actually indicated what (if any) problems you think exist in valgrind's scripts - are there some scripts you think aren't working because of this? Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |
|
From: Bart V. A. <bar...@gm...> - 2009-02-07 17:06:12
|
On Sat, Feb 7, 2009 at 4:47 PM, Tom Hughes <to...@co...> wrote: > Bart Van Assche wrote: > > As known Ubuntu uses dash as default shell instead of bash. Since the >> shell scripts included with Valgrind intentionally use /bin/sh as >> their interpreter, these scripts do not only have to be POSIX >> compliant but also have to take the additional dash restrictions into >> account. An overview of bash and/or POSIX features that are not >> supported by dash can be found here: >> > > Are you really saying that /bin/sh on Ubuntu is not a POSIX compliant > bourne shell? That sounds very odd, and it does not appear to be what the > web page you referred to says either. Some features required by POSIX are missing in dash. As an example, dash does not support $LINENO, while this is required by POSIX. And apparently the website I referred to isn't even complete: e.g. bash supports constructs like ">&/dev/null", which is not supported by dash (and not required by POSIX), but not listed on the website I referred to. See also http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html. I'm also not very clear as to the point of your mail as you haven't actually > indicated what (if any) problems you think exist in valgrind's scripts - are > there some scripts you think aren't working because of this? > I posted this information because it is useful for anyone who maintains shell scripts distributed with Valgrind. See e.g. the subversion history of the vg-in-place script. Bart. |
|
From: Johannes S. <Joh...@gm...> - 2009-02-07 17:14:42
|
Hi,
On Sat, 7 Feb 2009, Tom Hughes wrote:
> Bart Van Assche wrote:
>
> > As known Ubuntu uses dash as default shell instead of bash. Since the
> > shell scripts included with Valgrind intentionally use /bin/sh as
> > their interpreter, these scripts do not only have to be POSIX
> > compliant but also have to take the additional dash restrictions into
> > account. An overview of bash and/or POSIX features that are not
> > supported by dash can be found here:
>
> Are you really saying that /bin/sh on Ubuntu is not a POSIX compliant
> bourne shell? That sounds very odd, and it does not appear to be what
> the web page you referred to says either.
Dash _is_ POSIX compliant, but unexpectedly so. For example, it is
technically POSIX-conformant to complain when "shift" was called without
parameters, but strange for bash users.
Other strangenesses include misinterpretation of 'printf "\x01"' (dash
only groks "\001"), enforcing "test ... =" (as opposed to understanding
"test ... ==") or dash's inability to interpret "$((echo $a; echo $b) |
uniq)" correctly (it misinterprets the "$((" as start of an arithmetic
expression.
As I said, technically it is POSIX. That does not mean prevent it
from being a total PITA.
> I'm also not very clear as to the point of your mail as you haven't
> actually indicated what (if any) problems you think exist in valgrind's
> scripts - are there some scripts you think aren't working because of
> this?
I have to say that the absence of a concrete issue struck me as odd, too.
Ciao,
Dscho
|