Joerg Schilling
This is a bash bug that has been fixed in bash-5.
Let me give some background information: When David Korn introduced $(cmd) in ksh88, he thought that this could be implemented with a simple parser that just counts brackets. To permit this, he introduced the openning bracket: "switch ... case (x)" but it turns out that there are many other cases in the shell command language that need a recursive parser to support $(cmd), e.g. here documents that are par of a $(cmd) construct. Let me explain how bosh and mksh implement it: - First the parser is called with the string similar to: "cmd)" and told to stop parsing at a superfluous ")". - The syntax tree that is the output from the parser is then fed into the code that prints shell input from the binary tree (this has been introduced for printing functions. - This string is than kept in the syntax tree from the main parser call. If you do it this way, there is no need to fail in the parser... Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org