bug-bash
[Top][All Lists]
Advanced

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

Badly behaved commmand substitution recursion.


From: kehoea
Subject: Badly behaved commmand substitution recursion.
Date: Thu, 21 Dec 2000 22:04:47 +0100 (MET)

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DHOSTTYPE='sparc' -DOSTYPE='solaris2.7' 
-DMACHTYPE='sparc-sun-solaris2.7' -DSHELL -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I. -I. -I./lib -g -O2
uname output: SunOS phenix 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10
Machine Type: sparc-sun-solaris2.7

Bash Version: 2.02
Patch Level: 1
Release Status: release

Description:

I'm not sure, maybe this is a posix requirement, but it seems that
command-expansion recursion stops at level 3, i.e. it substitutes the
output of the first 2 nested commmand substitutions, but no more. In the
example below, the $(cat filename) line should come out with "command
not found" as it tries to execute program "hi" with argument
"there". 

Repeat-By:

$ echo $BASH_VERSION
2.02.1(1)-release
$ echo "echo \`echo hi there\`" > filename
$ cat filename
echo `echo hi there`
$ $(cat filename)
`echo hi there`

        [Describe the sequence of events that causes the problem
        to occur.]

Try to use 3 levels of commmand substitution. 

Sorry, haven't got the time to fix the thing *just* now ...




reply via email to

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