Christian Weisgerber <[email protected]> wrote: >I guess. There _are_ problems in this area, though. > >$ case x in x);; *);; esac >$ echo $(case x in x);; *);; esac) >ksh: syntax error: `;;' unexpected
This should probably be in BUGS section, not as a note in the middle of the manual. Eg.: Index: ksh.1 =================================================================== RCS file: /var/cvs/src/bin/ksh/ksh.1,v retrieving revision 1.179 diff -u -p -r1.179 ksh.1 --- ksh.1 27 Apr 2016 12:46:23 -0000 1.179 +++ ksh.1 18 Aug 2016 12:33:49 -0000 @@ -1007,12 +1007,6 @@ has the same effect as .Ic $(cat foo) , but it is carried out more efficiently because no process is started. .Pp -.Sy Note : -.Pf $( Ar command ) -expressions are currently parsed by finding the matching parenthesis, -regardless of quoting. -This should be fixed soon. -.Pp Arithmetic substitutions are replaced by the value of the specified expression. For example, the command .Ic echo $((2+3*4)) @@ -5561,3 +5555,14 @@ The .Pa CONTRIBUTORS file in the source distribution contains a more complete list of people and their part in the shell's development. +.Sh BUGS +.Pf $( Ar command ) +expressions are currently parsed by finding the closest matching (unquoted) +parenthesis. +Thus some constructs inside +.Pf $( Ar command ) +may produce an error. +For example, parenthesis in +.Ql x);; +is interpreted as closing parenthesis in +.Ql $(case x in x);; *);; esac) .
