diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-03 14:56:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-03 14:56:52 +0200 |
commit | fbf44854a3b7a32a0a0ff1a03f4163d25f2d62af (patch) | |
tree | b3963985e0dbaab4ef100a3c214cdf664dcc4aa9 /shell/ash_test | |
parent | 49015a60cb334ecd0b069f27833a3d50853509fa (diff) | |
download | busybox-w32-fbf44854a3b7a32a0a0ff1a03f4163d25f2d62af.tar.gz busybox-w32-fbf44854a3b7a32a0a0ff1a03f4163d25f2d62af.tar.bz2 busybox-w32-fbf44854a3b7a32a0a0ff1a03f4163d25f2d62af.zip |
hush: support "f() (cmd)" functions
Many other shells support this construct
function old new delta
parse_stream 2950 3018 +68
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-misc/func5.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/func5.tests | 5 | ||||
-rw-r--r-- | shell/ash_test/ash-misc/func_compound1.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/func_compound1.tests | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/shell/ash_test/ash-misc/func5.right b/shell/ash_test/ash-misc/func5.right index 2c9d316b3..01e79c32a 100644 --- a/shell/ash_test/ash-misc/func5.right +++ b/shell/ash_test/ash-misc/func5.right | |||
@@ -1,6 +1,3 @@ | |||
1 | 1 | 1 | 1 |
2 | 2 | 2 | 2 |
3 | 3 | 3 | 3 |
4 | 1 | ||
5 | 2 | ||
6 | 3 | ||
diff --git a/shell/ash_test/ash-misc/func5.tests b/shell/ash_test/ash-misc/func5.tests index e967208cc..5c33560bc 100755 --- a/shell/ash_test/ash-misc/func5.tests +++ b/shell/ash_test/ash-misc/func5.tests | |||
@@ -6,8 +6,3 @@ f 2 | |||
6 | 6 | ||
7 | f() ( echo $1 ) | 7 | f() ( echo $1 ) |
8 | f 3 | 8 | f 3 |
9 | |||
10 | f() for i in 1 2 3; do | ||
11 | echo $i | ||
12 | done | ||
13 | f | ||
diff --git a/shell/ash_test/ash-misc/func_compound1.right b/shell/ash_test/ash-misc/func_compound1.right new file mode 100644 index 000000000..01e79c32a --- /dev/null +++ b/shell/ash_test/ash-misc/func_compound1.right | |||
@@ -0,0 +1,3 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | 3 | ||
diff --git a/shell/ash_test/ash-misc/func_compound1.tests b/shell/ash_test/ash-misc/func_compound1.tests new file mode 100755 index 000000000..20c8bf18b --- /dev/null +++ b/shell/ash_test/ash-misc/func_compound1.tests | |||
@@ -0,0 +1,4 @@ | |||
1 | f() for i in 1 2 3; do | ||
2 | echo $i | ||
3 | done | ||
4 | f | ||