1 ## compare_shells: bash zsh mksh
2
3 #### git-completion snippet
4
5 # copied directly from git completion - 2024-04
6
7 if false; then
8 unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null
9 fi
10 echo status=$?
11
12 ## STDOUT:
13 status=0
14 ## END
15
16 #### asdf snippet
17
18 # copied directly from asdf - 2024-04
19
20 if false; then
21 ASDF_DIR=${(%):-%x}
22 fi
23
24 ## STDOUT:
25 ## END
26
27 #### zsh var sub is rejected at runtime
28
29 echo z ${(m)foo} z
30 echo status=$?
31
32 ## status: 1
33 ## STDOUT:
34 ## END
35
36 ## OK zsh status: 0
37 ## OK zsh STDOUT:
38 z z
39 status=0
40 ## END
41
42 ## OK bash status: 0
43 ## OK bash STDOUT:
44 status=1
45 ## END