qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/5] configure to set shell type


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/5] configure to set shell type
Date: Fri, 16 Mar 2012 16:19:57 +0000

On 16 March 2012 15:58, Eric Blake <address@hidden> wrote:
> On 03/16/2012 06:35 AM, Peter Maydell wrote:
>> The way I expect this to work is that /bin/sh should be a posix shell...
>
> Then your expectations are wrong.  POSIX itself says that /bin/sh need
> not be the POSIX shell, and merely requires that you can query for a
> conforming PATH to use, and that the 'sh' found on that PATH search is
> the POSIX shell (that is, 'command -p sh' will be conforming, but won't
> necessarily be /bin/sh).

Yes, well strictly POSIX says that "If the first line of a file of shell
commands starts with the characters "#!" , the results are unspecified",
so we're already in the realm of undefined behaviour if we put anything
at the top of our shell scripts.

>  This weasel-wording is intentionally written
> specifically for Solaris, since they refuse to make /bin/sh
> POSIX-conforming ("it might break 30-year-old legacy scripts - gasp!"),
> and instead set their conforming PATH to have /usr/xpg4/bin (or these
> days, /usr/xpg6/bin:/usr/xpg4/bin) prior to /bin.

Google suggests that Solaris 11 finally kicks the legacy bourne shell
out of /bin/sh...

(I'm mostly just pushing back a little at uglifying our build scripts
for the sake of a weirdo outlier if there's a different fix (eg in this
case it looks like the script really is a bash script) that's less ugly.)

-- PMM



reply via email to

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