declare within function: Forget about what I wrote.
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 uname output: Linux tazzelwurm 2.6.11hcz1 #2 Fri Mar 11 20:01:21 CET 2005 i686 GNU/Linux Machine Type: i386-pc-linux-gnu Bash Version: 3.0 Patch Level: 16 Release Status: release Description: Forget my last message about what the declare statement does when used within a function. I apologize for wasting your time. Greetings, Heike ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
"declare" builtin creates local variables within functions
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 uname output: Linux tazzelwurm 2.6.11hcz1 #2 Fri Mar 11 20:01:21 CET 2005 i686 GNU/Linux Machine Type: i386-pc-linux-gnu Bash Version: 3.0 Patch Level: 16 Release Status: release Description: When variables are created with the "declare" builtin while in a function, they go out of scope when the function is left. Repeat-By: #!/bin/bash foo(){ declare bar="y" echo local: declare -p bar } declare baz=12 foo echo global: declare -p bar baz This outputs: local: declare -- bar="y" global: ./x.sh: line 12: declare: bar: not found declare -- baz="12" Note: "bar" in the example above is not really handled like a generic local variable. If the variable is already known at global level, the "declare" within the function assigns to the global. So doing a "bar=" before the "declare" is executed (even within the function) makes the error disapper. Thanks for your good job, Heike ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Undeliverable Mail
Delivery Failed: [EMAIL PROTECTED] Due to the increase in the number of viruses outbreak contained in the scr format, the mail server does not accept E-mail with attachments that contain the scr extension. Please rename the extension to .vip and inform the recipient to rename it back to scr Thank you for your understanding. Original message follows: Received: from gnpkg.com [61.90.101.112] by mail3.cybersite.com.sg with ESMTP (SMTPD32-8.13) id A2486BD402D8; Wed, 06 Apr 2005 09:58:32 +0800 From: bug-bash@gnu.org To: [EMAIL PROTECTED] Subject: Mail Delivery (failure [EMAIL PROTECTED]) Date: Wed, 6 Apr 2005 08:57:22 +0700 MIME-Version: 1.0 Content-Type: multipart/related; type="multipart/alternative"; boundary="=_NextPart_000_001B_01C0CA80.6B015D10" X-Priority: 3 X-MSMail-Priority: Normal Message-Id: <[EMAIL PROTECTED]> --- [This E-mail was scanned for viruses.] ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash
Soporte Técnico a equipos Apple / Macintosh
<>Saludos -- http://www.emergenciasmac.com/ [EMAIL PROTECTED] [EMAIL PROTECTED] Av. Colonia Del Valle 735, Col. Del Valle México D.F. 03100 5536 3035 / 5536 2893 SOLUCION DE PROBLEMAS EN EQUIPOS MACINTOSH Reparamos y optimizamos todo tipo de equipo Macintosh. Técnicos certificados por Apple Una empresa con más de 15 años de experiencia en equipos Macintosh. Gracias por su tiempo y considerar nuestro servicio. SI no desea seguir recibiendo noticias de productos Apple, ofertas y servicios, por favor conteste este mail con el título U N S U B S C R I B E. Gracias. ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash