[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gettext] gettext.sh and bash "shopt -o -s nounset"
From: |
Thorsten Kampe |
Subject: |
[bug-gettext] gettext.sh and bash "shopt -o -s nounset" |
Date: |
Thu, 12 May 2011 20:22:02 +0200 |
Hi,
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
- [bug-gettext] gettext.sh and bash "shopt -o -s nounset",
Thorsten Kampe <=