bug-bash
[Top][All Lists]
Advanced

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

unable to capture return value using backticks and local


From: Adam Monsen
Subject: unable to capture return value using backticks and local
Date: Tue, 8 Aug 2006 16:14:14 -0700

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-redhat-linux-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include
-I./lib  -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables
uname output: Linux localhost.localdomain 2.6.17-1.2157_FC5 #1 Tue Jul
11 22:55:46 EDT 2006 i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 3.1
Patch Level: 7
Release Status: release

Description:
       When a variable is declared local and the assigned value is
gathered from
a command enclosed in backticks, it is not possible to retrieve the return value
of the function within the backticks. Is this expected behavior?

Repeat-By:
       The following code snippet describes the issue at hand:

TICKED=`false`
echo RV: $?
# prints "RV: 1"

foo()
{
   local TICKED=`false`
   echo RV: $?
}

foo
# prints "RV: 0", but I would expect "RV: 1"


--
Adam Monsen




reply via email to

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