Results for array.test.sh

casebashmkshoshosh_ALTdescription
0pass pass pass pass SETUP
1pass pass pass pass "${a[@]}" and "${a[*]}"
2pass pass pass pass ${a[@]} and ${a[*]}
3pass pass pass pass 4 ways to interpolate empty array
4pass pass pass pass empty array
5pass pass pass pass Empty array with :-
6BUG BUG pass pass nounset with empty array (design bug, makes it hard to use arrays)
detailsdetails
7pass BUG pass pass local array
details
8pass pass pass pass Command with with word splitting in array
9pass ok pass pass space before ( in array initialization
details
10pass pass pass pass array over multiple lines
11pass ok pass pass array with invalid token
details
12pass pass pass pass array with empty string
13pass pass pass pass Retrieve index
14pass pass pass pass Retrieve out of bounds index
15pass N-I pass pass Negative index
details
16pass pass pass pass Retrieve index that is a variable
17pass pass pass pass Retrieve index that is a variable without $
18pass pass pass pass Retrieve index that is a command sub
19pass pass FAIL FAIL Retrieve all indices with !
detailsdetails
20pass N-I pass pass ${!a[1]} is named ref in bash
details
21pass ok FAIL FAIL Retrieve indices without []
detailsdetailsdetails
22pass pass pass pass All elements unquoted
23pass pass pass pass All elements quoted
24pass pass pass pass $*
25pass pass pass pass "$*"
26pass pass pass pass Interpolate array into array
27pass ok ok ok Exporting array doesn't do anything, not even first element
detailsdetailsdetails
28pass BUG FAIL FAIL Env with array
detailsdetailsdetails
29pass pass FAIL FAIL Set element
detailsdetails
30pass pass FAIL FAIL Set element with var ref
detailsdetails
31pass pass FAIL FAIL Set element with array ref
detailsdetails
32pass N-I FAIL FAIL Set array item to array
detailsdetailsdetails
33pass N-I FAIL FAIL Slice of array with [@]
detailsdetailsdetails
34pass N-I FAIL FAIL Negative slice
detailsdetailsdetails
35pass N-I FAIL FAIL Slice with arithmetic
detailsdetailsdetails
36pass pass pass pass Number of elements
37pass pass pass pass Length of an element
38pass pass pass pass Iteration
39pass pass pass pass glob within array yields separate elements
40pass pass pass pass declare array and then append
41pass ok pass pass Array syntax in wrong place
details
42ok ok ok ok Single array with :-
detailsdetailsdetailsdetails
43pass N-I pass pass Stripping a whole array unquoted
details
44pass N-I pass pass Stripping a whole array quoted
details
45BUG ok pass pass Multiple subscripts not allowed
detailsdetails
46BUG ok pass pass Length op, index op, then transform op is not allowed
detailsdetails
47BUG BUG pass pass Array subscript not allowed on string
detailsdetails
48pass pass pass pass Create a "user" array out of the argv array
49pass pass pass pass Tilde expansion within array
50pass pass pass pass Brace Expansion within Array
51pass pass pass pass array default

159 passed, 13 ok, 8 known unimplemented, 8 known bugs, 10 failed, 0 skipped

Details on runs that didn't PASS

bash6 nounset with empty array (design bug, makes it hard to use arrays)

stdout:
stderr: 
/bin/bash: line 3: empty[@]: unbound variable
mksh6 nounset with empty array (design bug, makes it hard to use arrays)

stdout:
stderr: 
/bin/mksh: <stdin>[3]: empty[@]: parameter not set
mksh7 local array

stdout:
stderr: 
/bin/mksh: <stdin>[2]: syntax error: '(' unexpected
mksh9 space before ( in array initialization

stdout:
1
stderr:
mksh11 array with invalid token

stdout:
stderr: 
/bin/mksh: <stdin>[3]: syntax error: '&' unexpected
mksh15 Negative index

stdout:
['', '', '']
stderr:
osh19 Retrieve all indices with !

[osh stdout] Expected "['0', '1']\n", got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 509, in <module>
    main(sys.argv)
  File "bin/osh", line 492, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 748, in _EvalBracedVarSub
    val = self._ApplyPrefixOp(val, part.prefix_op)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 555, in _ApplyPrefixOp
    return self.mem.GetVar(val.s)
AttributeError: 'StrArray' object has no attribute 's'
osh_ALT19 Retrieve all indices with !

[osh_ALT stdout] Expected "['0', '1']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 509, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 492, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 748, in _EvalBracedVarSub
    val = self._ApplyPrefixOp(val, part.prefix_op)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 555, in _ApplyPrefixOp
    return self.mem.GetVar(val.s)
AttributeError: 'StrArray' object has no attribute 's'
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
mksh20 ${!a[1]} is named ref in bash

stdout:
['a[1]']
stderr:
mksh21 Retrieve indices without []

stdout:
['a']
stderr:
osh21 Retrieve indices without []

[osh stdout] Expected "['']\n", got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 509, in <module>
    main(sys.argv)
  File "bin/osh", line 492, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 748, in _EvalBracedVarSub
    val = self._ApplyPrefixOp(val, part.prefix_op)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 555, in _ApplyPrefixOp
    return self.mem.GetVar(val.s)
AttributeError: 'StrArray' object has no attribute 's'
osh_ALT21 Retrieve indices without []

[osh_ALT stdout] Expected "['']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 509, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 492, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 748, in _EvalBracedVarSub
    val = self._ApplyPrefixOp(val, part.prefix_op)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 555, in _ApplyPrefixOp
    return self.mem.GetVar(val.s)
AttributeError: 'StrArray' object has no attribute 's'
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
mksh27 Exporting array doesn't do anything, not even first element

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
osh27 Exporting array doesn't do anything, not even first element

stdout:
stderr: 
Line 1 of '<stdin>'
  export PYTHONPATH=(a b c)
         ^~~~~~~~~~~
Unexpected array literal: (CompoundWord
  parts: [
    (ArrayLiteralPart
      words: [
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:4))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:6))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:c span_id:8))])
      ]
    )
  ]
)
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
osh_ALT27 Exporting array doesn't do anything, not even first element

stdout:
stderr: 
Line 1 of '<stdin>'
  export PYTHONPATH=(a b c)
         ^~~~~~~~~~~
Unexpected array literal: (CompoundWord
  parts: [
    (ArrayLiteralPart
      words: [
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:4))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:6))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:c span_id:8))])
      ]
    )
  ]
)
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
mksh28 Env with array

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
osh28 Env with array

[osh stdout] Expected u'a\n(b b)\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
Line 1 of '<stdin>'
  A=a B=(b b) printenv.py A B
         ^
Unexpected array literal in binding: (CompoundWord
  parts: [
    (ArrayLiteralPart
      words: [
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:5))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:7))])
      ]
    )
  ]
)
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
osh_ALT28 Env with array

[osh_ALT stdout] Expected u'a\n(b b)\n', got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
Line 1 of '<stdin>'
  A=a B=(b b) printenv.py A B
         ^
Unexpected array literal in binding: (CompoundWord
  parts: [
    (ArrayLiteralPart
      words: [
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:5))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:7))])
      ]
    )
  ]
)
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
osh29 Set element

[osh stdout] Expected "['9', '2 3']\n", got "['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[0]=9', ['a[0]=9'], ...): [Errno 2] No such file or directory
osh_ALT29 Set element

[osh_ALT stdout] Expected "['9', '2 3']\n", got "['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[0]=9', ['a[0]=9'], ...): [Errno 2] No such file or directory
osh30 Set element with var ref

[osh stdout] Expected "['9', '2 3']\n", got "['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[0]=9', ['a[0]=9'], ...): [Errno 2] No such file or directory
osh_ALT30 Set element with var ref

[osh_ALT stdout] Expected "['9', '2 3']\n", got "['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[0]=9', ['a[0]=9'], ...): [Errno 2] No such file or directory
osh31 Set element with array ref

[osh stdout] Expected "['1', '9']\n", got "['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[1]=9', ['a[1]=9'], ...): [Errno 2] No such file or directory
osh_ALT31 Set element with array ref

[osh_ALT stdout] Expected "['1', '9']\n", got "['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[1]=9', ['a[1]=9'], ...): [Errno 2] No such file or directory
mksh32 Set array item to array

stdout:
stderr: 
/bin/mksh: <stdin>[2]: set: a[0]: is not an identifier
osh32 Set array item to array

[osh stdout] Expected 'status=1\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
Line 2 of '<stdin>'
  a[0]=(3 4)
        ^
Expected word type Right_FuncDef, got (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:3 span_id:13))])
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
osh_ALT32 Set array item to array

[osh_ALT stdout] Expected 'status=1\n', got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
Line 2 of '<stdin>'
  a[0]=(3 4)
        ^
Expected word type Right_FuncDef, got (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:3 span_id:13))])
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
mksh33 Slice of array with [@]

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${a[@]: 1:2}: bad substitution
osh33 Slice of array with [@]

[osh stdout] Expected "['2', '3']\n", got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 509, in <module>
    main(sys.argv)
  File "bin/osh", line 492, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:18))])
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:20))])
    )
)
osh_ALT33 Slice of array with [@]

[osh_ALT stdout] Expected "['2', '3']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 509, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 492, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:18))])
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:20))])
    )
)
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
mksh34 Negative slice

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${a[@]: (-2):1}: bad substitution
osh34 Negative slice

[osh stdout] Expected "['2']\n", got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 509, in <module>
    main(sys.argv)
  File "bin/osh", line 492, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithUnary
      op_id: Node_UnaryMinus
      child: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:20))])
        )
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:23))])
    )
)
osh_ALT34 Negative slice

[osh_ALT stdout] Expected "['2']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 509, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 492, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithUnary
      op_id: Node_UnaryMinus
      child: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:20))])
        )
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:23))])
    )
)
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
mksh35 Slice with arithmetic

stdout:
stderr: 
/bin/mksh: <stdin>[3]: ${a[@]:i-4:2}: bad substitution
osh35 Slice with arithmetic

[osh stdout] Expected "['2', '3']\n", got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 509, in <module>
    main(sys.argv)
  File "bin/osh", line 492, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithBinary
      op_id: Arith_Minus
      left: (ArithVarRef name:i)
      right: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:23))])
        )
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:25))])
    )
)
osh_ALT35 Slice with arithmetic

[osh_ALT stdout] Expected "['2', '3']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 509, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 492, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 413, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 862, in _EvalWordPart
    return [self._EvalDoubleQuotedPart(part)]
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 603, in _EvalDoubleQuotedPart
    for part_val in self._EvalWordPart(p, quoted=True):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithBinary
      op_id: Arith_Minus
      left: (ArithVarRef name:i)
      right: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:23))])
        )
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:25))])
    )
)
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
mksh41 Array syntax in wrong place

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
bash42 Single array with :-

stdout:
['none', 'x', '']
stderr:
mksh42 Single array with :-

stdout:
['none', 'x', 'none']
stderr:
osh42 Single array with :-

stdout:
['x', '']
stderr:
osh_ALT42 Single array with :-

stdout:
['x', '']
stderr:
mksh43 Stripping a whole array unquoted

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
mksh44 Stripping a whole array quoted

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
bash45 Multiple subscripts not allowed

stdout:
['123', '123']
stderr:
mksh45 Multiple subscripts not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${a[0][0]}: bad substitution
bash46 Length op, index op, then transform op is not allowed

stdout:
3 3
stderr:
mksh46 Length op, index op, then transform op is not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${#a[0]/1/xxx}: bad substitution
bash47 Array subscript not allowed on string

stdout:
abc
stderr:
mksh47 Array subscript not allowed on string

stdout:
abc
stderr: