Implement $(cmd) subcommand syntax in commands (issue #27)
Add $() for inline subcommand substitution that runs a command and
inserts its stdout (trailing newlines stripped) into the outer command
string. Supports nesting, and mixing with ${expr} and $NAME.
This commit is contained in:
3
llex.h
3
llex.h
@@ -81,8 +81,9 @@ typedef struct LexState {
|
||||
TString *brkn; /* "break" name (used as a label) */
|
||||
TString *glbn; /* "global" name (when not a reserved word) */
|
||||
TString *cmd_envvar; /* envvar name for $NAME in commands */
|
||||
lu_byte cmd_mode; /* 0=normal, 1=backtick command, 2=interactive command */
|
||||
lu_byte cmd_mode; /* 0=normal, 1=backtick, 2=interactive, 3=subcommand */
|
||||
lu_byte saved_cmd_mode; /* cmd_mode to restore after interpolation */
|
||||
lu_byte cmd_subcmd; /* 1 when current interpolation is $() subcommand */
|
||||
} LexState;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user