Compound command question

#1
If I say "comment_one & command_two" (specifically with command_one being an alias) is there any way that can be known to command_one that it is an antecedent in a compound command?

If not, perhaps a future version could set a flag (_COMPOUND?) specifying the separator following any part (but the last) of a compound command.
 

rconn

Administrator
Staff member
May 14, 2008
10,554
97
#2
If I say "comment_one & command_two" (specifically with command_one being an alias) is there any way that can be known to command_one that it is an antecedent in a compound command?
No. But that's not really a compound command -- it's just multiple commands, and as far as the parser is concerned it isn't any different than separating them with a CR/LF. And command groups, single line aliases, multiline FOR statements, etc. are all collapsed into a single line with a & separating each command. So I don't understand how this would be useful to you.

(A real compound command separator would be && or ||.)