[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POSIXLY_CORRECT not correctly unset in getopt.m4?
From: |
Bruno Haible |
Subject: |
Re: POSIXLY_CORRECT not correctly unset in getopt.m4? |
Date: |
Wed, 8 Sep 2010 11:30:01 +0200 |
User-agent: |
KMail/1.9.9 |
[removing bug-standards from the CC list]
Paolo Bonzini wrote:
> On 09/07/2010 10:39 PM, Eric Blake wrote:
> > gl_awk_probe='BEGIN { for (v in ENVIRON)
> > if (v == "POSIXLY_CORRECT") print "x" }'
> > case ${POSIXLY_CORRECT:+x}`awk "$gl_awk_probe" </dev/null` in
> > xx) gl_had_POSIXLY_CORRECT=exported ;;
> > x) gl_had_POSIXLY_CORRECT=yes ;;
> > *) gl_had_POSIXLY_CORRECT= ;;
> > esac
>
> Walking all of ENVIRON seems slow.
But it handles an empty exported value correctly:
export POSIXLY_CORRECT=
has the same semantics as
export POSIXLY_CORRECT=1
> What about
>
> gl_awk_probe='BEGIN {print !!length(ENVIRON["POSIXLY_CORRECT"])}'
> case ${POSIXLY_CORRECT:+x}`awk "$gl_awk_probe" </dev/null` in
> x1) gl_had_POSIXLY_CORRECT=exported ;;
> x0) gl_had_POSIXLY_CORRECT=yes ;;
> *) gl_had_POSIXLY_CORRECT= ;;
> esac
>
> instead?
It handles an empty exported value as if the variable was not exported.
Bruno
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, (continued)
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Ralf Wildenhues, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Ralf Wildenhues, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/07
- [PATCH] getopt: handle POSIXLY_CORRECT set but not exported, Eric Blake, 2010/09/07
- Re: [PATCH] getopt: handle POSIXLY_CORRECT set but not exported, Dustin J. Mitchell, 2010/09/07
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Paolo Bonzini, 2010/09/08
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?,
Bruno Haible <=
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Paolo Bonzini, 2010/09/08
- Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/08
Re: POSIXLY_CORRECT not correctly unset in getopt.m4?, Eric Blake, 2010/09/07