Package: bash
Version: 3.1dfsg-8
Severity: normal

I'm not sure how to make a test case out of this because it only happens
for one case out of many in a program.  The summary is:  I have a
function 'global_getopt_scan' I use to parse arguments, and return the
array GLOBAL_ARGS to the caller.

1) use "declare -ax GLOBAL_ARGS"
2) put stuff in GLOBAL_ARGS
3) use GLOBAL_ARGS after return from global_getopt_scan

For the script at 

http://danielwebb.us/misc/bash_bug2

call

$ bash_bug2 --debug --verbose --test -two ads
bash_bug2 [14:35]: 2 GLOBAL_ARGS=(--debug --verbose)
bash_bug2 [14:35]: 2 NON_GLOBAL_ARGS=(--test2 --test3)
bash_bug2 [14:35]: GLOBALS: LOGFILE=/tmp/bash_bug2.root.nerd.log FILELIST= 
DEBUG=true VERBOSE=true
bash_bug2 [14:35]:          VERIFY_ONLY_ON_SOURCE=true 
VERIFY_ONLY_ON_DESTINATION=true
bash_bug2 [14:35]:          VERIFY_CURRENT_CHECKSUMS=true 
VERIFY_HISTORIC_CHECKSUMS=true
bash_bug2 [14:35]:          SHOW_PROGRESS=true 
FILELIST_DELIMITER=--line-delimited
bash_bug2 [14:35]:          CROSS_FILESYSTEM_BOUNDARIES=false
./bash_bug2: line 2360: GLOBAL_ARGS[*]: unbound variable

This only happens with the call to global_getopt_scan at line 2359,
although I use the same technique throughout the program.

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-xen-k7
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages bash depends on:
ii  base-files                   4           Debian base system miscellaneous f
ii  debianutils                  2.17        Miscellaneous utilities specific t
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries
ii  libncurses5                  5.5-5       Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to