[Top][All Lists]

[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' 
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


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


$ 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]