=============================== Commands =============================== whoami --- (program (command (command_name))) =============================== Commands with arguments =============================== cat file1.txt cat -n file1.txt file2.txt --- (program (command (command_name) (argument)) (command (command_name) (argument) (argument) (argument))) =============================== Commands with string arguments =============================== echo "hello $(whoami), this is $(uname)" echo 'hi' --- (program (command (command_name) (quoted_argument (command_substitution (command (command_name))) (command_substitution (command (command_name))))) (command (command_name) (single_quoted_argument))) =================================== Commands with environment variables =================================== VAR1=1 ./script/test VAR1=a VAR2="ok" git diff --word-diff=color --- (program (command (environment_variable_assignment (variable_name) (argument)) (command_name)) (command (environment_variable_assignment (variable_name) (argument)) (environment_variable_assignment (variable_name) (quoted_argument)) (command_name) (argument) (argument))) =================================== Pipelines =================================== whoami | cat cat foo | grep -v bar --- (program (pipeline (command (command_name)) (command (command_name))) (pipeline (command (command_name) (argument)) (command (command_name) (argument) (argument)))) =================================== Lists =================================== a | b && c && d; d e f || e g --- (program (list (list (pipeline (command (command_name)) (command (command_name))) (command (command_name))) (command (command_name))) (list (command (command_name) (argument) (argument)) (command (command_name) (argument)))) =============================== File redirects =============================== whoami > /dev/null cat a b 2> /dev/null 2>&1 whoami --- (program (command (command_name) (file_redirect (file_name))) (command (command_name) (argument) (argument) (file_redirect (file_descriptor) (file_name))) (command (file_redirect (file_descriptor) (file_descriptor)) (command_name))) =============================== Variable expansions =============================== cat $FOO --- (program (command (command_name) (expansion (variable_name)))) =============================== Variable expansion operators =============================== cat ${BAR} ${ABC=def} ${GHI:?jkl} --- (program (command (command_name) (operator_expansion (variable_name)) (operator_expansion (variable_name) (argument)) (operator_expansion (variable_name) (argument)))) =============================== Heredoc redirects =============================== node <