[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] bash4-3 ,in configure file. help!
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] bash4-3 ,in configure file. help! |
Date: |
Tue, 8 Nov 2016 09:50:58 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Nov 08, 2016 at 10:00:30PM +0800, Ta wrote:
> for bash4-3 ,in configure file:
> if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
> emulate sh
> NULLCMD=:
> # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
> # is contrary to our usage. Disable this feature.
> alias -g '${1+"$@"}'='"$@"'
> setopt NO_GLOB_SUBST
>
>
>
>
> what ${ZSH_VERSION+set} will do?
It is testing whether the variable ZSH_VERSION is set.
See http://mywiki.wooledge.org/BashFAQ/083
... which I see has been hacked apart by the optimizers, who don't
understand that the page is intended to be *read by humans*, not
to be a platform for showing how cleverly they can code. An older
version is simpler and has more explanation:
http://mywiki.wooledge.org/BashFAQ/083?action=recall&rev=11
> what command the emulate is ?why i cannot find the shell?
I'm guessing it's a zsh command. As you can see, it's only run when
we have detected that we're being executed by zsh (as indicated by
the test for the ZSH_VERSION variable being set).
> what setopt NO_GLOB_SUBST means?
It could be another zsh command. All I know is that it's not a bash
command.