The Perl comparison is not really helpful. That is a rigorously defined term in Perl, with specific meanings that affect how variables are treated in Perl. The term list context isn't an "official" thing in the shell world. It isn't mentioned anywhere in POSIX, for example. Note how the term is actually defined in most of the cases you point out where it is used: the very answer you link to (emphasis mine):
[. . .] on all words in list context (command line arguments or the words the for loops loop on)
There are two contexts in shell syntax: list context and string context. Field splitting and filename generation only happen in list context, but that's most of the time. Double quotes delimit a string context: the whole double-quoted string is a single string, not to be split.
So, essentially when you see the term "list context" with respect to a shell, this isn't an official term and is basically just used to mean "not explicitly a string", in other words, subject to split+glob and shell expansion.
POSIX does actually use list (not "list context"), but in two very different ways. It uses is as a specific, defined term to describe sets of commands (emphasis in the original):
An AND-OR list is a sequence of one or more pipelines separated by the operators "&&" and "||" .
A list is a sequence of one or more AND-OR lists separated by the
operators ';' and '&'.
The operators "&&" and "||" shall have equal precedence and shall be
evaluated with left associativity. For example, both of the following
commands write solely bar to standard output:
false && echo foo || echo bar
true || echo foo && echo bar
A ';' separator or a ';' or terminator shall cause the
preceding AND-OR list to be executed sequentially; an '&' separator or
terminator shall cause asynchronous execution of the preceding AND-OR
The term "compound-list" is derived from the grammar in Shell Grammar;
it is equivalent to a sequence of lists, separated by
characters, that can be preceded or followed by an arbitrary number of
However, the word list, since it is also the term used in everyday English to denote a set of items, is used quite often in the POSIX specs, usually to refer to lists of arguments. For example:
- The shell performs various expansions (separately) on different parts of each command, resulting in a list of pathnames and fields to be treated as a command and arguments; see wordexp.
If a simple command results in a command name and an optional list of arguments, the following actions shall be performed:
The for loop shall execute a sequence of commands for each member in a list of items.
[. . .]
First, the list of words following in shall be expanded to generate a list of items.
Returning to the top of the loop involves repeating the condition list of a while or until loop or performing the next assignment of a for loop, and re-executing the loop if appropriate.
All this is to say that when we refer to "list context" with respect to a shell, we are not using a strict, rigorously defined term such as Perl's, we're just referring to things the shell will treat as a list of items. Things that will be expanded, split, globbed etc. So, practically, any non-quoted collection of characters could be considered a list.