help-gnu-utils
[Top][All Lists]
Advanced

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

gettext.sh and bash "shopt -o -s nounset"


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

Hi,

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.

Using...

    shopt -o -s errexit nounset
    source gettext.sh

...in a script results in:
/usr/bin/gettext.sh: line 43: ZSH_VERSION: unbound variable

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

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

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

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?

Thorsten
gettext 0.18.1.1 on Gentoo Linux and on Cygwin




reply via email to

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