Re: Tightening up specification of /bin/sh
Zack Weinberg wrote:
> > According to POSIX they shouldn't ignore the value in the
> > environment. At least ash seems to get this right:
>
> My reading of the XPG/4 page is that shells are allowed to honor or
> ignore it as they see fit. Therefore, this is a case where my
> proposal triggers. Ash honors the value in the environment, but bash,
> pdksh, AT&T ksh, and /bin/sh from three different proprietary Unix
> clones all ignore it. Therefore, under my proposal, ash is buggy.
>
> If POSIX says explicitly that it must be honored, that's news to me.
Hmm... As I read page 123 (Shell Command Language, Variables)
shells can't ignore the value in the environment:
"Variables shall be initialized from the environment ..."
"The following variables shall affect the execution of the
shell:"
"IFS ..."
However at page 416-417 (sh, Environment Variables) they can:
"The following environment variables shall affect the execution
of sh:"
"IFS ... Implementations may ignore the value of IFS in the
environment at the time sh is invoked, treating IFS as if it were
not set."
I asked about this on the austin-group-l@opengroup.org mailing
list, but didn't got any answer.
--
Patrik Hägglund
Reply to: