history length = 1 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 0 line: (SourceLine line_num:1 content:'echo ${two:-}' src:(source.MainFile path:'')) tval: echo ) ] ), (compound_word parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 5 length: 2 span_id: 2 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Name col: 7 length: 3 span_id: 3 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: two ) var_name: two suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 10 length: 2 span_id: 4 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: _ ) arg_word: (compound_word parts:[]) ) right: (Token id: Id.Right_DollarBrace col: 12 length: 1 span_id: 5 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: '}' ) ) ] )] ! echo ${two:-} history length = 1 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 7 line: (SourceLine line_num:1 content:'echo ${two:-}' src:(source.MainFile path:'')) tval: echo ) ] ), (compound_word parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 5 length: 2 span_id: 9 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Name col: 7 length: 3 span_id: 10 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: two ) var_name: two suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 10 length: 2 span_id: 11 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: _ ) arg_word: (compound_word parts:[]) ) right: (Token id: Id.Right_DollarBrace col: 12 length: 1 span_id: 12 line: (SourceLine line_num: 1 content: 'echo ${two:-}' src: (source.MainFile path:'') ) tval: '}' ) ) ] )] .! echo 'hi#'${two:-} history length = 1 Couldn't parse historical command '(': TRAIL words: [] history length = 1 Couldn't parse historical command 'a( )': TRAIL words: [] .history length = 1 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 10 length: 2 span_id: 6 line: (SourceLine line_num:1 content:'echo hi | wc -l' src:(source.MainFile path:'')) tval: wc ) ] ), (compound_word parts: [ (Token id: Id.Lit_Chars col: 13 length: 2 span_id: 8 line: (SourceLine line_num:1 content:'echo hi | wc -l' src:(source.MainFile path:'')) tval: -l ) ] )] ! echo -l history length = 1 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 19 length: 4 span_id: 15 line: (SourceLine line_num: 1 content: 'for i in 1 2 3; do echo xx; done' src: (source.MainFile path:'') ) tval: echo ) ] ), (compound_word parts: [ (Token id: Id.Lit_Chars col: 24 length: 2 span_id: 17 line: (SourceLine line_num: 1 content: 'for i in 1 2 3; do echo xx; done' src: (source.MainFile path:'') ) tval: xx ) ] )] ! echo xx history length = 1 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 2 line: (SourceLine line_num:1 content:'{ echo yy; }' src:(source.MainFile path:'')) tval: echo ) ] ), (compound_word parts: [ (Token id: Id.Lit_Chars col: 7 length: 2 span_id: 4 line: (SourceLine line_num:1 content:'{ echo yy; }' src:(source.MainFile path:'')) tval: yy ) ] )] .! echo yy history length = 2 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 0 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: echo ) ] ), (compound_word parts: [ (simple_var_sub left: (Token id: Id.VSub_DollarName col: 5 length: 6 span_id: 2 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '$three' ) var_name: three ) ] ), (compound_word parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 12 length: 2 span_id: 4 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Number col: 14 length: 1 span_id: 5 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: 4 ) var_name: 4 suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 15 length: 2 span_id: 6 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: _ ) arg_word: (compound_word parts:[]) ) right: (Token id: Id.Right_DollarBrace col: 17 length: 1 span_id: 7 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '}' ) ) ] ), (compound_word parts: [ (double_quoted left: (Token id: Id.Left_DoubleQuote col: 19 length: 1 span_id: 9 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '"' ) parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 20 length: 2 span_id: 10 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Name col: 22 length: 4 span_id: 11 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: five ) var_name: five suffix_op: (Token id: Id.VOp0_P col: 26 length: 2 span_id: 12 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: _ ) right: (Token id: Id.Right_DollarBrace col: 28 length: 1 span_id: 13 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '}' ) ) ] right: (Token id: Id.Right_DoubleQuote col: 29 length: 1 span_id: 14 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '"' ) ) ] )] ! echo "${five@P}" history length = 2 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 16 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: echo ) ] ), (compound_word parts: [ (simple_var_sub left: (Token id: Id.VSub_DollarName col: 5 length: 6 span_id: 18 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '$three' ) var_name: three ) ] ), (compound_word parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 12 length: 2 span_id: 20 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Number col: 14 length: 1 span_id: 21 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: 4 ) var_name: 4 suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 15 length: 2 span_id: 22 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: _ ) arg_word: (compound_word parts:[]) ) right: (Token id: Id.Right_DollarBrace col: 17 length: 1 span_id: 23 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '}' ) ) ] ), (compound_word parts: [ (double_quoted left: (Token id: Id.Left_DoubleQuote col: 19 length: 1 span_id: 25 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '"' ) parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 20 length: 2 span_id: 26 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Name col: 22 length: 4 span_id: 27 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: five ) var_name: five suffix_op: (Token id: Id.VOp0_P col: 26 length: 2 span_id: 28 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: _ ) right: (Token id: Id.Right_DollarBrace col: 28 length: 1 span_id: 29 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '}' ) ) ] right: (Token id: Id.Right_DoubleQuote col: 29 length: 1 span_id: 30 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '"' ) ) ] )] ! echo $three history length = 2 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 0 length: 4 span_id: 32 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: echo ) ] ), (compound_word parts: [ (simple_var_sub left: (Token id: Id.VSub_DollarName col: 5 length: 6 span_id: 34 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '$three' ) var_name: three ) ] ), (compound_word parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 12 length: 2 span_id: 36 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Number col: 14 length: 1 span_id: 37 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: 4 ) var_name: 4 suffix_op: (suffix_op.Unary op: (Token id: Id.VTest_ColonHyphen col: 15 length: 2 span_id: 38 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: _ ) arg_word: (compound_word parts:[]) ) right: (Token id: Id.Right_DollarBrace col: 17 length: 1 span_id: 39 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '}' ) ) ] ), (compound_word parts: [ (double_quoted left: (Token id: Id.Left_DoubleQuote col: 19 length: 1 span_id: 41 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '"' ) parts: [ (braced_var_sub left: (Token id: Id.Left_DollarBrace col: 20 length: 2 span_id: 42 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '${' ) token: (Token id: Id.VSub_Name col: 22 length: 4 span_id: 43 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: five ) var_name: five suffix_op: (Token id: Id.VOp0_P col: 26 length: 2 span_id: 44 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: _ ) right: (Token id: Id.Right_DollarBrace col: 28 length: 1 span_id: 45 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '}' ) ) ] right: (Token id: Id.Right_DoubleQuote col: 29 length: 1 span_id: 46 line: (SourceLine line_num: 1 content: 'echo $three ${4:-} "${five@P}"' src: (source.MainFile path:'') ) tval: '"' ) ) ] )] .! echo -n $three ${4:-} "${five@P}" history length = 3 ! echo ${two:-} history length = 3 ! echo ${two:-} history length = 3 ! echo 1 history length = 3 ! ls /echo/ history length = 3 ! echo ${two:-} history length = 3 history length = 3 history length = 3 ! ls /echo/ history length = 3 TRAIL words: [(compound_word parts: [ (Token id: Id.Lit_Chars col: 0 length: 2 span_id: 0 line: (SourceLine line_num:1 content:'ls /echo/' src:(source.MainFile path:'')) tval: ls ) ] ), (compound_word parts: [ (Token id: Id.Lit_Chars col: 3 length: 6 span_id: 2 line: (SourceLine line_num:1 content:'ls /echo/' src:(source.MainFile path:'')) tval: '/echo/' ) ] )] . ---------------------------------------------------------------------- Ran 5 tests in 0.039s OK ! echo /echo/