(CommandList children: [ (C {(Lit_Other ":")} {(Lit_Other ":")} {(generated)} {(by)} {(mkptytests)} {(from)} {(DQ ("posix-sh-*-c.pty"))} {(Lit_Other ":")} {(Lit_Other ":")} ) (FuncDef name: err_exit body: (BraceGroup children: [ (C {(print)} {(-u2)} {(-n)} {(DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\t">))}) (C {(print)} {(-u2)} {(-r)} {(${ VSub_Name Command) (Lit_Other "[") ($ VSub_Number "$1") (Lit_Other "]") (Lit_Other ":") } { (DQ (BracedVarSub token: <VSub_At "@"> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)})) spids: [118 122] ) ) } ) (DParen child:(UnaryAssign op_id:Node_PostDPlus child:(LhsName name:Errors))) ] spids: [89] ) spids: [85 88] ) (C {(alias)} {(Lit_VarLike "err_exit=") (SQ <"err_exit $lineno">)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:Command) op: Equal rhs: { (BracedVarSub token: <VSub_Number 0> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("*") (Lit_Slash /)}) spids: [146 151] ) } spids: [145] ) ] spids: [145] ) (C {(integer)} {(Lit_VarLike "Errors=") (0)} {(Lit_VarLike "lineno=") (1)}) (AndOr children: [ (C {(whence)} {(-q)} {(pty)}) (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:lineno) op: Equal rhs: {($ VSub_Name "$LINENO")} spids: [172] ) ] spids: [172] ) terminator: <Op_Semi ";"> ) (Sentence child: (C {(err_exit)} {(DQ ("pty command not found -- tests skipped"))}) terminator: <Op_Semi ";"> ) (Sentence child:(C {(exit)} {(0)}) terminator:<Op_Semi ";">) ] spids: [170] ) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bintrue) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(whence)} {(-p)} {(true)})]) left_token: <Left_CommandSub "$("> spids: [192 198] ) } spids: [191] ) ] spids: [191] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{($ VSub_Name "$SHELL")}] redirects: [ (HereDoc op_id: Redir_DLessDash fd: -1 body: {("trap 'exit 0' EXIT\n") ("bintrue=$(whence -p true)\n") ("set -o monitor\n") ("{\n") ("eval $'set -o vi\\npty $bintrue'\n") ("} < /dev/null & pid=$!\n") ("#sleep 1\n") ("jobs\n") ("kill $$\n") } do_expansion: False here_end: EOF was_filled: True spids: [206] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [202 211] ) } spids: [201] ) ] spids: [201] ) (AndOr children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$x")} right: {(Lit_Other "*") (Stop) (Lit_Other "*")} ) ) (C {(err_exit)} {(SQ <"monitor mode enabled incorrectly causes job to stop">)}) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [(DBracket expr:(BoolUnary op_id:BoolUnary_o child:{(xtrace)}))] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:debug) op: Equal rhs: {(--debug) (Lit_Other "=") (1)} spids: [246] ) ] spids: [246] ) ] spids: [-1 244] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:debug) op:Equal rhs:{(SQ )} spids:[253])] spids: [253] ) ] spids: [251 255] ) (FuncDef name: tst body: (BraceGroup children: [ (C {(integer)} {(Lit_VarLike "lineno=") ($ VSub_Number "$1")} {(offset)}) (C {(typeset)} {(text)}) (Pipeline children: [ (C {(pty)} {($ VSub_Name "$debug")} {(--dialogue)} {(--messages) (Lit_Other "=") (SQ </dev/fd/1>)} {($ VSub_Name "$SHELL")} ) (While cond: [(C {(read)} {(-r)} {(text)})] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$text")} right: {(Lit_Other "*") (debug) (Lit_Other "*")} ) ) ] action: [(C {(print)} {(-u2)} {(-r)} {(--)} {(DQ ($ VSub_Name "$text"))})] spids: [-1 322] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:offset) op: Equal rhs: { (BracedVarSub token: <VSub_Name text> suffix_op: (PatSub pat: {("*: line +([[:digit:]]):*")} replace: {(EscapedLiteralPart token:<Lit_EscapedChar "\\1">)} do_all: False do_prefix: False do_suffix: False ) spids: [340 346] ) } spids: [339] ) ] spids: [339] ) (C {(err_exit)} { (DQ (BracedVarSub token: <VSub_Name text> suffix_op: (PatSub pat: {(": line ") ($ VSub_Name "$offset") (":")} replace: {(": line ") (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithVarRef name:lineno) right: (ArithVarRef name:offset) ) spids: [360 368] ) (":") } do_all: False do_prefix: False do_suffix: False ) spids: [352 370] ) ) } ) ] spids: [337 374] ) ] spids: [305 377] ) ) ] negated: False ) ] spids: [262] ) spids: [258 261] ) (C {(export)} {(Lit_VarLike "PS1=") (SQ <":test-!: ">)} {(Lit_VarLike "PS2=") (SQ <"> ">)} {(Lit_VarLike "PS4=") (SQ <": ">)} {(Lit_VarLike "ENV=")} {(Lit_VarLike "EXINIT=")} {(Lit_VarLike "HISTFILE=")} {(Lit_VarLike "TERM=") (dumb)} {(Lit_VarLike "VISUAL=") (vi)} {(Lit_VarLike "LC_ALL=") (C)} ) (If arms: [ (if_arm cond: [ (Pipeline children: [ (SimpleCommand words: [{(pty)} {($ VSub_Name "$bintrue")}] redirects: [(Redir op_id:Redir_Less fd:-1 arg_word:{(/dev/null)} spids:[423])] ) ] negated: True ) ] action: [ (C {(err_exit)} {(pty)} {(command)} {(hangs)} {(on)} {($ VSub_Name "$bintrue")} {(--)} {(tests)} {(skipped)} ) (C {(exit)} {(0)}) ] spids: [-1 427] ) ] spids: [-1 452] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 026(C)\n") ("\n") ("# If the User Portability Utilities Option is supported: When the\n") ("# POSIX locale is specified and a background job is suspended by a\n") ("# SIGTSTP signal then the <state> field in the output message is set to\n") ("# Stopped, Suspended, Stopped(SIGTSTP) or Suspended(SIGTSTP).\n") ("\n") ("I ^\\r?\\n$\n") ("p :test-1:\n") ("w sleep 60 &\n") ("u [[:digit:]]\\r?\\n$\n") ("s 100\n") ("p :test-2:\n") ("w kill -TSTP $!\n") ("u (Stopped|Suspended)\n") ("p :test-3:\n") ("w kill -KILL $!\n") ("w wait\n") ("u (Killed|Done)\n") } do_expansion: False here_end: "!" was_filled: True spids: [462] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 028(C)\n") ("\n") ("# If the User Portability Utilities Option is supported: When the\n") ("# POSIX locale is specified and a background job is suspended by a\n") ("# SIGTTIN signal then the <state> field in the output message is set to\n") ("# Stopped(SIGTTIN) or Suspended(SIGTTIN).\n") ("\n") ("I ^\\r?\\n$\n") ("p :test-1:\n") ("w sleep 60 &\n") ("u [[:digit:]]\\r?\\n$\n") ("s 100\n") ("p :test-2:\n") ("w kill -TTIN $!\n") ("u (Stopped|Suspended) \\(SIGTTIN\\)\n") ("p :test-3:\n") ("w kill -KILL $!\n") ("w wait\n") ("u (Killed|Done)\n") } do_expansion: False here_end: "!" was_filled: True spids: [475] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 029(C)\n") ("\n") ("# If the User Portability Utilities Option is supported: When the\n") ("# POSIX locale is specified and a background job is suspended by a\n") ("# SIGTTOU signal then the <state> field in the output message is set to\n") ("# Stopped(SIGTTOU) or Suspended(SIGTTOU).\n") ("\n") ("I ^\\r?\\n$\n") ("p :test-1:\n") ("w sleep 60 &\n") ("u [[:digit:]]\\r?\\n$\n") ("s 100\n") ("p :test-2:\n") ("w kill -TTOU $!\n") ("u (Stopped|Suspended) \\(SIGTTOU\\)\n") ("p :test-3:\n") ("w kill -KILL $!\n") ("w wait\n") ("u (Killed|Done)\n") } do_expansion: False here_end: "!" was_filled: True spids: [488] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 091(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode an entered\n") ("# character other than <newline>, erase, interrupt, kill, control-V,\n") ("# control-W, backslash \\ (followed by erase or kill), end-of-file and\n") ("# <ESC> is inserted in the current command line.\n") ("\n") ("c echo h\n") ("c ell\n") ("w o\n") ("u ^hello\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [501] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 093(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: After termination of a previous\n") ("# command, sh is entered in insert mode.\n") ("\n") ("w echo hello\n") ("u ^hello\\r?\\n$\n") ("c echo goo\n") ("c dby\n") ("w e\n") ("u ^goodbye\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [514] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 094(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode an <ESC>\n") ("# switches sh into command mode.\n") ("\n") ("c echo he\\E\n") ("s 400\n") ("w allo\n") ("u ^hello\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [527] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 096(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in command mode the\n") ("# interrupt character causes sh to terminate command line editing on\n") ("# the current command line, re-issue the prompt on the next line of the\n") ("# terminal and to reset the command history so that the command that\n") ("# was interrupted is not entered in the history.\n") ("\n") ("I ^\\r?\\n$\n") ("p :test-1:\n") ("w echo first\n") ("p :test-2:\n") ("w stty intr ^C\n") ("p :test-3:\n") ("c echo bad\\E\n") ("s 400\n") ("c \\cC\n") ("w echo scrambled\n") ("p :test-4:\n") ("w history\n") ("u echo first\n") ("r stty intr \\^C\n") ("r echo\n") ("r history\n") } do_expansion: False here_end: "!" was_filled: True spids: [540] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 097(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode a <newline>\n") ("# causes the current command line to be executed.\n") ("\n") ("c echo ok\\n\n") ("u ^ok\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [553] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 099(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode the interrupt\n") ("# character causes sh to terminate command line editing on the current\n") ("# command line, re-issue the prompt on the next line of the terminal\n") ("# and to reset the command history so that the command that was\n") ("# interrupted is not entered in the history.\n") ("\n") ("I ^\\r?\\n$\n") ("p :test-1:\n") ("w echo first\n") ("u ^first\n") ("p :test-2:\n") ("w stty intr ^C\n") ("r\n") ("p :test-3:\n") ("c echo bad\\cC\n") ("w echo last\n") ("p :test-4:\n") ("w history\n") ("u echo first\n") ("r stty intr \\^C\n") ("r echo last\n") ("r history\n") } do_expansion: False here_end: "!" was_filled: True spids: [566] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 100(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode the kill\n") ("# character clears all the characters from the input line.\n") ("\n") ("p :test-1:\n") ("w stty kill ^X\n") ("p :test-2:\n") ("c echo bad\\cX\n") ("w echo ok\n") ("u ^ok\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [579] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 101(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode a control-V\n") ("# causes the next character to be inserted even in the case that the\n") ("# character is a special insert mode character.\n") ("# Testing Requirements: The assertion must be tested with at least the\n") ("# following set of characters: <newline>, erase, interrupt, kill,\n") ("# control-V, control-W, end-of-file, backslash \\ (followed by erase or\n") ("# kill) and <ESC>.\n") ("\n") ("d 10\n") ("p :test-1:\n") ("w stty erase ^H intr ^C kill ^X\n") ("p :test-2:\n") ("w echo erase=:\\cV\\cH:\n") ("u ^erase=:\\r?\\n$\n") ("p :test-3:\n") ("w echo kill=:\\cV\\cX:\n") ("u ^kill=:\\cX:\\r?\\n$\n") ("p :test-4:\n") ("w echo control-V=:\\cV\\cV:\n") ("u ^control-V=:\\cV:\\r?\\n$\n") ("p :test-5:\n") ("w echo control-W:\\cV\\cW:\n") ("u ^control-W:\\cW:\\r?\\n$\n") ("p :test-6:\n") ("w echo EOF=:\\cV\\cD:\n") ("u ^EOF=:\\004:\\r?\\n$\n") ("p :test-7:\n") ("w echo backslash-erase=:\\\\\\cH:\n") ("u ^backslash-erase=:\\r?\\n$\n") ("p :test-8:\n") ("w echo backslash-kill=:\\\\\\cX:\n") ("u ^backslash-kill=:\\cX:\\r?\\n$\n") ("p :test-9:\n") ("w echo ESC=:\\cV\\E:\n") ("u ^ESC=:\\E:\\r?\\n$\n") ("p :test-10:\n") ("w echo interrupt=:\\cV\\cC:\n") ("u ^interrupt=:\\cC:\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [592] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 104(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in insert mode an\n") ("# end-of-file at the beginning of an input line is interpreted as the\n") ("# end of input.\n") ("\n") ("p :test-1:\n") ("w trap 'echo done >&2' EXIT\n") ("p :test-2:\n") ("s 100\n") ("c \\cD\n") ("u ^done\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [605] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 111(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in command mode, # inserts\n") ("# the character # at the beginning of the command line and causes the\n") ("# line to be treated as a comment and the line is entered in the\n") ("# command history.\n") ("\n") ("p :test-1:\n") ("c echo save\\E\n") ("s 400\n") ("c #\n") ("p :test-2:\n") ("w history\n") ("u #echo save\n") ("r history\n") } do_expansion: False here_end: "!" was_filled: True spids: [618] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 137(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in command mode, then v\n") ("# invokes the vi editor to edit the current command line in a temporary\n") ("# file. When the editor exits, the commands in the temporary file are\n") ("# executed.\n") ("\n") ("p :test-1:\n") ("c echo hello\\E\n") ("s 400\n") ("c v\n") ("u /tmp/\n") ("c A world\\E\n") ("s 400\n") ("w :wq\n") ("u ^hello world\\r?\\n$\n") } do_expansion: False here_end: "!" was_filled: True spids: [631] ) ] ) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L POSIX sh 251(C)\n") ("\n") ("# If the User Portability Utilities Option is supported and shell\n") ("# command line editing is supported: When in command mode, then the\n") ("# command N repeats the most recent / or ? command, reversing the\n") ("# direction of the search.\n") ("\n") ("p :test-1:\n") ("w echo repeat-1\n") ("u ^repeat-1\\r?\\n$\n") ("p :test-2:\n") ("w echo repeat-2\n") ("u ^repeat-2\\r?\\n$\n") ("p :test-3:\n") ("s 100\n") ("c \\E\n") ("s 400\n") ("w /rep\n") ("u echo repeat-2\n") ("c n\n") ("r echo repeat-1\n") ("c N\n") ("r echo repeat-2\n") ("w dd\n") ("p :test-3:\n") ("w echo repeat-3\n") ("u ^repeat-3\\r?\\n$\n") ("p :test-4:\n") ("s 100\n") ("c \\E\n") ("s 400\n") ("w ?rep\n") ("r echo repeat-2\n") ("c N\n") ("r echo repeat-1\n") ("c n\n") ("r echo repeat-2\n") ("c n\n") ("r echo repeat-3\n") } do_expansion: False here_end: "!" was_filled: True spids: [644] ) ] ) (AndOr children: [ (C {(whence)} {(-q)} {(less)}) (SimpleCommand words: [{(tst)} {($ VSub_Name "$LINENO")}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("L process/terminal group exercise\n") ("\n") ("w m=yes; while true; do echo $m-$m; done | less\n") ("u :$|:\\E|lines\n") ("c \\cZ\n") ("r Stopped\n") ("w fg\n") ("u yes-yes\n") } do_expansion: False here_end: "!" was_filled: True spids: [668] ) ] more_env: [(env_pair name:TERM val:{(vt100)} spids:[661])] ) ] op_id: Op_DAmp ) (C {(exit)} { (ArithSubPart anode: (TernaryOp cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:Errors) right: (ArithWord w:{(Lit_Digits 125)}) ) true_expr: (ArithVarRef name:Errors) false_expr: (ArithWord w:{(Lit_Digits 125)}) ) spids: [676 685] ) } ) ] )