On 5/25/23 8:13 AM, Robert Elz wrote:
Note that ${C } is not a group - it is syntax that delimits a command substituition in a word, and what's in a command substitution is a list (which can contain groups, or be one, but isn't required to be).
There's not any real difference. A group command is '{' compound_list '}', a nofork command substitution is '${' compound_list '}', and a command substitution is '$(' compound_list ')'. (Similar to how a subshell command is '(' compound_list ')' ). This is consistent with the POSIX grammar. The difference, as you say, is that a command substitution is allowed as part of a word, so the closing brace isn't a reserved word according to the strict definition. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/