diff options
-rw-r--r-- | shell/ash_test/ash-redir/redir_escapednum.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_escapednum.tests | 2 | ||||
-rw-r--r-- | shell/ash_test/ash-redir/redir_expand.right | 18 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_expand.tests | 85 | ||||
-rw-r--r-- | shell/ash_test/ash-redir/redir_multi.right | 4 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_multi.tests | 5 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir2.right | 2 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir2.tests | 7 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir4.right | 19 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir4.tests | 157 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir6.right | 4 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir6.tests | 8 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_escapednum.right | 1 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir_escapednum.tests | 2 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_expand.right | 18 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir_expand.tests | 85 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_multi.right | 4 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir_multi.tests | 5 |
18 files changed, 313 insertions, 114 deletions
diff --git a/shell/ash_test/ash-redir/redir_escapednum.right b/shell/ash_test/ash-redir/redir_escapednum.right new file mode 100644 index 000000000..7326d9603 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_escapednum.right | |||
@@ -0,0 +1 @@ | |||
Ok | |||
diff --git a/shell/ash_test/ash-redir/redir_escapednum.tests b/shell/ash_test/ash-redir/redir_escapednum.tests new file mode 100755 index 000000000..81983cae2 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_escapednum.tests | |||
@@ -0,0 +1,2 @@ | |||
1 | echo NOT SHOWN \2>/dev/null | ||
2 | echo Ok | ||
diff --git a/shell/ash_test/ash-redir/redir_expand.right b/shell/ash_test/ash-redir/redir_expand.right new file mode 100644 index 000000000..ead25f603 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_expand.right | |||
@@ -0,0 +1,18 @@ | |||
1 | shell_test | ||
2 | \shell_test | ||
3 | \shell_test | ||
4 | \shell_test | ||
5 | Here1 | ||
6 | Ok1 | ||
7 | Here2 | ||
8 | Ok2 | ||
9 | Here3 | ||
10 | Ok3 | ||
11 | Here4 | ||
12 | Ok4 | ||
13 | Now with variable refs | ||
14 | shell_test_1 | ||
15 | \shell_test_1 | ||
16 | \shell_test_1 | ||
17 | \shell_test_1 | ||
18 | Done | ||
diff --git a/shell/ash_test/ash-redir/redir_expand.tests b/shell/ash_test/ash-redir/redir_expand.tests new file mode 100755 index 000000000..c50b8cedf --- /dev/null +++ b/shell/ash_test/ash-redir/redir_expand.tests | |||
@@ -0,0 +1,85 @@ | |||
1 | rm *shell_test* 2>/dev/null | ||
2 | |||
3 | >\shell_test | ||
4 | echo *shell_test* | ||
5 | rm *shell_test* | ||
6 | |||
7 | >\\shell_test | ||
8 | echo *shell_test* | ||
9 | rm *shell_test* | ||
10 | |||
11 | >"\shell_test" | ||
12 | echo *shell_test* | ||
13 | rm *shell_test* | ||
14 | |||
15 | >"\\shell_test" | ||
16 | echo *shell_test* | ||
17 | rm *shell_test* | ||
18 | |||
19 | |||
20 | cat <<\shell_test | ||
21 | Here1 | ||
22 | shell_test | ||
23 | echo Ok1 | ||
24 | |||
25 | cat <<\\shell_test | ||
26 | Here2 | ||
27 | \shell_test | ||
28 | echo Ok2 | ||
29 | |||
30 | cat <<"\shell_test" | ||
31 | Here3 | ||
32 | \shell_test | ||
33 | echo Ok3 | ||
34 | |||
35 | cat <<"\\shell_test" | ||
36 | Here4 | ||
37 | \shell_test | ||
38 | echo Ok4 | ||
39 | |||
40 | |||
41 | echo Now with variable refs | ||
42 | i=1 | ||
43 | |||
44 | |||
45 | >\shell_test_$i | ||
46 | echo *shell_test* | ||
47 | rm *shell_test* | ||
48 | |||
49 | >\\shell_test_$i | ||
50 | echo *shell_test* | ||
51 | rm *shell_test* | ||
52 | |||
53 | >"\shell_test_$i" | ||
54 | echo *shell_test* | ||
55 | rm *shell_test* | ||
56 | |||
57 | >"\\shell_test_$i" | ||
58 | echo *shell_test* | ||
59 | rm *shell_test* | ||
60 | |||
61 | echo Done;exit | ||
62 | # UNFIXED BUG. bash apparently will expand $i even in terminating delimiter. | ||
63 | # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html | ||
64 | # does not mandate this behavior. | ||
65 | # This is not likely to be used much in real-world. | ||
66 | |||
67 | cat <<\shell_test_$i | ||
68 | Here1 | ||
69 | shell_test_$i | ||
70 | echo Ok1 | ||
71 | |||
72 | cat <<\\shell_test_$i | ||
73 | Here2 | ||
74 | \shell_test_$i | ||
75 | echo Ok2 | ||
76 | |||
77 | cat <<"\shell_test_$i" | ||
78 | Here3 | ||
79 | \shell_test_$i | ||
80 | echo Ok3 | ||
81 | |||
82 | cat <<"\\shell_test_$i" | ||
83 | Here4 | ||
84 | \shell_test_$i | ||
85 | echo Ok4 | ||
diff --git a/shell/ash_test/ash-redir/redir_multi.right b/shell/ash_test/ash-redir/redir_multi.right new file mode 100644 index 000000000..a97c4bdf1 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_multi.right | |||
@@ -0,0 +1,4 @@ | |||
1 | Testing multiple redirections to same fd | ||
2 | Hello | ||
3 | Done1 | ||
4 | Done2 | ||
diff --git a/shell/ash_test/ash-redir/redir_multi.tests b/shell/ash_test/ash-redir/redir_multi.tests new file mode 100755 index 000000000..c639ebb2d --- /dev/null +++ b/shell/ash_test/ash-redir/redir_multi.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | echo "Testing multiple redirections to same fd" | ||
2 | # bug was making us lose fd #1 after this: | ||
3 | echo Hello >/dev/null 1>&2 | ||
4 | echo Done1 | ||
5 | echo Done2 >&2 | ||
diff --git a/shell/hush_test/hush-redir/redir2.right b/shell/hush_test/hush-redir/redir2.right index 7326d9603..d86bac9de 100644 --- a/shell/hush_test/hush-redir/redir2.right +++ b/shell/hush_test/hush-redir/redir2.right | |||
@@ -1 +1 @@ | |||
Ok | OK | ||
diff --git a/shell/hush_test/hush-redir/redir2.tests b/shell/hush_test/hush-redir/redir2.tests index 81983cae2..61ccea30c 100755 --- a/shell/hush_test/hush-redir/redir2.tests +++ b/shell/hush_test/hush-redir/redir2.tests | |||
@@ -1,2 +1,5 @@ | |||
1 | echo NOT SHOWN \2>/dev/null | 1 | # ash once couldn't redirect above fd#9 |
2 | echo Ok | 2 | exec 1>/dev/null |
3 | (echo LOST1 >&22) 22>&1 | ||
4 | (echo LOST2 >&22) 22>&1 | ||
5 | (echo OK >&22) 22>&2 | ||
diff --git a/shell/hush_test/hush-redir/redir4.right b/shell/hush_test/hush-redir/redir4.right index ead25f603..d86bac9de 100644 --- a/shell/hush_test/hush-redir/redir4.right +++ b/shell/hush_test/hush-redir/redir4.right | |||
@@ -1,18 +1 @@ | |||
1 | shell_test | OK | |
2 | \shell_test | ||
3 | \shell_test | ||
4 | \shell_test | ||
5 | Here1 | ||
6 | Ok1 | ||
7 | Here2 | ||
8 | Ok2 | ||
9 | Here3 | ||
10 | Ok3 | ||
11 | Here4 | ||
12 | Ok4 | ||
13 | Now with variable refs | ||
14 | shell_test_1 | ||
15 | \shell_test_1 | ||
16 | \shell_test_1 | ||
17 | \shell_test_1 | ||
18 | Done | ||
diff --git a/shell/hush_test/hush-redir/redir4.tests b/shell/hush_test/hush-redir/redir4.tests index c50b8cedf..4bdf5ae27 100755 --- a/shell/hush_test/hush-redir/redir4.tests +++ b/shell/hush_test/hush-redir/redir4.tests | |||
@@ -1,85 +1,72 @@ | |||
1 | rm *shell_test* 2>/dev/null | 1 | # ash uses fd 10 (usually) for reading the script |
2 | 2 | exec 13>&- | |
3 | >\shell_test | 3 | exec 12>&- |
4 | echo *shell_test* | 4 | exec 11>&- |
5 | rm *shell_test* | 5 | exec 10>&- |
6 | 6 | # some amount of input is prefetched. | |
7 | >\\shell_test | 7 | # make sure final echo is far enough to not be prefetched. |
8 | echo *shell_test* | 8 | ############################################################### |
9 | rm *shell_test* | 9 | ############################################################### |
10 | 10 | ############################################################### | |
11 | >"\shell_test" | 11 | ############################################################### |
12 | echo *shell_test* | 12 | ############################################################### |
13 | rm *shell_test* | 13 | ############################################################### |
14 | 14 | ############################################################### | |
15 | >"\\shell_test" | 15 | ############################################################### |
16 | echo *shell_test* | 16 | ############################################################### |
17 | rm *shell_test* | 17 | ############################################################### |
18 | 18 | ############################################################### | |
19 | 19 | ############################################################### | |
20 | cat <<\shell_test | 20 | ############################################################### |
21 | Here1 | 21 | ############################################################### |
22 | shell_test | 22 | ############################################################### |
23 | echo Ok1 | 23 | ############################################################### |
24 | 24 | ############################################################### | |
25 | cat <<\\shell_test | 25 | ############################################################### |
26 | Here2 | 26 | ############################################################### |
27 | \shell_test | 27 | ############################################################### |
28 | echo Ok2 | 28 | ############################################################### |
29 | 29 | ############################################################### | |
30 | cat <<"\shell_test" | 30 | ############################################################### |
31 | Here3 | 31 | ############################################################### |
32 | \shell_test | 32 | ############################################################### |
33 | echo Ok3 | 33 | ############################################################### |
34 | 34 | ############################################################### | |
35 | cat <<"\\shell_test" | 35 | ############################################################### |
36 | Here4 | 36 | ############################################################### |
37 | \shell_test | 37 | ############################################################### |
38 | echo Ok4 | 38 | ############################################################### |
39 | 39 | ############################################################### | |
40 | 40 | ############################################################### | |
41 | echo Now with variable refs | 41 | ############################################################### |
42 | i=1 | 42 | ############################################################### |
43 | 43 | ############################################################### | |
44 | 44 | ############################################################### | |
45 | >\shell_test_$i | 45 | ############################################################### |
46 | echo *shell_test* | 46 | ############################################################### |
47 | rm *shell_test* | 47 | ############################################################### |
48 | 48 | ############################################################### | |
49 | >\\shell_test_$i | 49 | ############################################################### |
50 | echo *shell_test* | 50 | ############################################################### |
51 | rm *shell_test* | 51 | ############################################################### |
52 | 52 | ############################################################### | |
53 | >"\shell_test_$i" | 53 | ############################################################### |
54 | echo *shell_test* | 54 | ############################################################### |
55 | rm *shell_test* | 55 | ############################################################### |
56 | 56 | ############################################################### | |
57 | >"\\shell_test_$i" | 57 | ############################################################### |
58 | echo *shell_test* | 58 | ############################################################### |
59 | rm *shell_test* | 59 | ############################################################### |
60 | 60 | ############################################################### | |
61 | echo Done;exit | 61 | ############################################################### |
62 | # UNFIXED BUG. bash apparently will expand $i even in terminating delimiter. | 62 | ############################################################### |
63 | # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html | 63 | ############################################################### |
64 | # does not mandate this behavior. | 64 | ############################################################### |
65 | # This is not likely to be used much in real-world. | 65 | ############################################################### |
66 | 66 | ############################################################### | |
67 | cat <<\shell_test_$i | 67 | ############################################################### |
68 | Here1 | 68 | ############################################################### |
69 | shell_test_$i | 69 | ############################################################### |
70 | echo Ok1 | 70 | ############################################################### |
71 | 71 | ############################################################### | |
72 | cat <<\\shell_test_$i | 72 | echo "OK" |
73 | Here2 | ||
74 | \shell_test_$i | ||
75 | echo Ok2 | ||
76 | |||
77 | cat <<"\shell_test_$i" | ||
78 | Here3 | ||
79 | \shell_test_$i | ||
80 | echo Ok3 | ||
81 | |||
82 | cat <<"\\shell_test_$i" | ||
83 | Here4 | ||
84 | \shell_test_$i | ||
85 | echo Ok4 | ||
diff --git a/shell/hush_test/hush-redir/redir6.right b/shell/hush_test/hush-redir/redir6.right index a97c4bdf1..ed754df78 100644 --- a/shell/hush_test/hush-redir/redir6.right +++ b/shell/hush_test/hush-redir/redir6.right | |||
@@ -1,4 +1,2 @@ | |||
1 | Testing multiple redirections to same fd | ||
2 | Hello | 1 | Hello |
3 | Done1 | 2 | OK |
4 | Done2 | ||
diff --git a/shell/hush_test/hush-redir/redir6.tests b/shell/hush_test/hush-redir/redir6.tests index c639ebb2d..33b6d4cd4 100755 --- a/shell/hush_test/hush-redir/redir6.tests +++ b/shell/hush_test/hush-redir/redir6.tests | |||
@@ -1,5 +1,3 @@ | |||
1 | echo "Testing multiple redirections to same fd" | 1 | # we had a bug where this would hang |
2 | # bug was making us lose fd #1 after this: | 2 | (head -n 1 <redir6.right) |
3 | echo Hello >/dev/null 1>&2 | 3 | echo OK |
4 | echo Done1 | ||
5 | echo Done2 >&2 | ||
diff --git a/shell/hush_test/hush-redir/redir_escapednum.right b/shell/hush_test/hush-redir/redir_escapednum.right new file mode 100644 index 000000000..7326d9603 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_escapednum.right | |||
@@ -0,0 +1 @@ | |||
Ok | |||
diff --git a/shell/hush_test/hush-redir/redir_escapednum.tests b/shell/hush_test/hush-redir/redir_escapednum.tests new file mode 100755 index 000000000..81983cae2 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_escapednum.tests | |||
@@ -0,0 +1,2 @@ | |||
1 | echo NOT SHOWN \2>/dev/null | ||
2 | echo Ok | ||
diff --git a/shell/hush_test/hush-redir/redir_expand.right b/shell/hush_test/hush-redir/redir_expand.right new file mode 100644 index 000000000..ead25f603 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_expand.right | |||
@@ -0,0 +1,18 @@ | |||
1 | shell_test | ||
2 | \shell_test | ||
3 | \shell_test | ||
4 | \shell_test | ||
5 | Here1 | ||
6 | Ok1 | ||
7 | Here2 | ||
8 | Ok2 | ||
9 | Here3 | ||
10 | Ok3 | ||
11 | Here4 | ||
12 | Ok4 | ||
13 | Now with variable refs | ||
14 | shell_test_1 | ||
15 | \shell_test_1 | ||
16 | \shell_test_1 | ||
17 | \shell_test_1 | ||
18 | Done | ||
diff --git a/shell/hush_test/hush-redir/redir_expand.tests b/shell/hush_test/hush-redir/redir_expand.tests new file mode 100755 index 000000000..c50b8cedf --- /dev/null +++ b/shell/hush_test/hush-redir/redir_expand.tests | |||
@@ -0,0 +1,85 @@ | |||
1 | rm *shell_test* 2>/dev/null | ||
2 | |||
3 | >\shell_test | ||
4 | echo *shell_test* | ||
5 | rm *shell_test* | ||
6 | |||
7 | >\\shell_test | ||
8 | echo *shell_test* | ||
9 | rm *shell_test* | ||
10 | |||
11 | >"\shell_test" | ||
12 | echo *shell_test* | ||
13 | rm *shell_test* | ||
14 | |||
15 | >"\\shell_test" | ||
16 | echo *shell_test* | ||
17 | rm *shell_test* | ||
18 | |||
19 | |||
20 | cat <<\shell_test | ||
21 | Here1 | ||
22 | shell_test | ||
23 | echo Ok1 | ||
24 | |||
25 | cat <<\\shell_test | ||
26 | Here2 | ||
27 | \shell_test | ||
28 | echo Ok2 | ||
29 | |||
30 | cat <<"\shell_test" | ||
31 | Here3 | ||
32 | \shell_test | ||
33 | echo Ok3 | ||
34 | |||
35 | cat <<"\\shell_test" | ||
36 | Here4 | ||
37 | \shell_test | ||
38 | echo Ok4 | ||
39 | |||
40 | |||
41 | echo Now with variable refs | ||
42 | i=1 | ||
43 | |||
44 | |||
45 | >\shell_test_$i | ||
46 | echo *shell_test* | ||
47 | rm *shell_test* | ||
48 | |||
49 | >\\shell_test_$i | ||
50 | echo *shell_test* | ||
51 | rm *shell_test* | ||
52 | |||
53 | >"\shell_test_$i" | ||
54 | echo *shell_test* | ||
55 | rm *shell_test* | ||
56 | |||
57 | >"\\shell_test_$i" | ||
58 | echo *shell_test* | ||
59 | rm *shell_test* | ||
60 | |||
61 | echo Done;exit | ||
62 | # UNFIXED BUG. bash apparently will expand $i even in terminating delimiter. | ||
63 | # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html | ||
64 | # does not mandate this behavior. | ||
65 | # This is not likely to be used much in real-world. | ||
66 | |||
67 | cat <<\shell_test_$i | ||
68 | Here1 | ||
69 | shell_test_$i | ||
70 | echo Ok1 | ||
71 | |||
72 | cat <<\\shell_test_$i | ||
73 | Here2 | ||
74 | \shell_test_$i | ||
75 | echo Ok2 | ||
76 | |||
77 | cat <<"\shell_test_$i" | ||
78 | Here3 | ||
79 | \shell_test_$i | ||
80 | echo Ok3 | ||
81 | |||
82 | cat <<"\\shell_test_$i" | ||
83 | Here4 | ||
84 | \shell_test_$i | ||
85 | echo Ok4 | ||
diff --git a/shell/hush_test/hush-redir/redir_multi.right b/shell/hush_test/hush-redir/redir_multi.right new file mode 100644 index 000000000..a97c4bdf1 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_multi.right | |||
@@ -0,0 +1,4 @@ | |||
1 | Testing multiple redirections to same fd | ||
2 | Hello | ||
3 | Done1 | ||
4 | Done2 | ||
diff --git a/shell/hush_test/hush-redir/redir_multi.tests b/shell/hush_test/hush-redir/redir_multi.tests new file mode 100755 index 000000000..c639ebb2d --- /dev/null +++ b/shell/hush_test/hush-redir/redir_multi.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | echo "Testing multiple redirections to same fd" | ||
2 | # bug was making us lose fd #1 after this: | ||
3 | echo Hello >/dev/null 1>&2 | ||
4 | echo Done1 | ||
5 | echo Done2 >&2 | ||