[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] and bash "shopt -o -s nounset"

From: Thorsten Kampe
Subject: and bash "shopt -o -s nounset"
Date: Thu, 12 May 2011 17:47:44 +0200
User-agent: MicroPlanet-Gravity/3.0.4


I hope this is the right forum for reporting gettext bugs.

In my bash scripts I set "nounset" (and errexit) to prevent unset 
variables from being used. Using variables which might not be set is 
convenient in interactive shell sessions but dangerous in non-
interactive scripts.


    shopt -o -s errexit nounset
    source a script results in:
/usr/bin/ line 43: ZSH_VERSION: unbound variable

...which refers to the following line in "if test -z 
"$ZSH_VERSION"; then".

if [ x${ZSH_VERSION+set} = xset ]
if [ -n "${ZSH_VERSION+x}" ]

portably test for the existence of a variable (tip from zsh mailing 

While there is a workaround for this (first sourcing, then setting 
"nounset"), I'd still consider this a bug. Is this enough to qualify for 
a bug report?

gettext on Gentoo Linux and on Cygwin

reply via email to

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