Skip to content

Shell Grammar: multiplecomplete_commands #263

Answered by 39555
39555 asked this question in Q&A
Discussion options

You must be logged in to vote

In older version of the standard there was only one complete_command See: Stackoverflow answer. Hovewer this was changed in https://www.austingroupbugs.net/view.php?id=1055&nbn=4 to allow streaming evaluation.

The separator between complete_commands is an arbitrary number of newlines, so the program:

echo hello
echo word

has 2 complete_commands.
According to Posix spec

complete_commands: complete_commands newline_list complete_command
                 |                                complete_command
                 ;
complete_command : list separator_op
                 | list
                 ;
list             : list separator_op and_or
                 |                   and_or
sep…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 39555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant