diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 12:56:34 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 12:56:34 +1000 |
commit | c31744ca1a86b2276c37c6d9a884660185debed6 (patch) | |
tree | bb051c35c3430a3793ceef173a01cb522fb4ae05 /shell | |
parent | 1a286d510c2125bdab601ce47afd4d27b6ce6f41 (diff) | |
parent | e329089c62ed813e97344f8c61d7dc34221fd5ee (diff) | |
download | busybox-w32-c31744ca1a86b2276c37c6d9a884660185debed6.tar.gz busybox-w32-c31744ca1a86b2276c37c6d9a884660185debed6.tar.bz2 busybox-w32-c31744ca1a86b2276c37c6d9a884660185debed6.zip |
Merge branch 'origin/master' (early part)
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Config.src | 107 | ||||
-rw-r--r-- | shell/Kbuild.src | 3 | ||||
-rw-r--r-- | shell/hush.c | 2 |
3 files changed, 60 insertions, 52 deletions
diff --git a/shell/Config.src b/shell/Config.src index 234d05367..800911966 100644 --- a/shell/Config.src +++ b/shell/Config.src | |||
@@ -5,57 +5,7 @@ | |||
5 | 5 | ||
6 | menu "Shells" | 6 | menu "Shells" |
7 | 7 | ||
8 | choice | 8 | INSERT |
9 | prompt "Choose which shell is aliased to 'sh' name" | ||
10 | default FEATURE_SH_IS_ASH | ||
11 | help | ||
12 | Choose which shell you want to be executed by 'sh' alias. | ||
13 | The ash shell is the most bash compatible and full featured one. | ||
14 | |||
15 | config FEATURE_SH_IS_ASH | ||
16 | select ASH | ||
17 | bool "ash" | ||
18 | depends on !NOMMU | ||
19 | |||
20 | config FEATURE_SH_IS_HUSH | ||
21 | select HUSH | ||
22 | bool "hush" | ||
23 | |||
24 | config FEATURE_SH_IS_NONE | ||
25 | bool "none" | ||
26 | |||
27 | endchoice | ||
28 | |||
29 | choice | ||
30 | prompt "Choose which shell is aliased to 'bash' name" | ||
31 | default FEATURE_BASH_IS_NONE | ||
32 | help | ||
33 | Choose which shell you want to be executed by 'bash' alias. | ||
34 | The ash shell is the most bash compatible and full featured one. | ||
35 | |||
36 | Note that selecting this option does not switch on any bash | ||
37 | compatibility code. It merely makes it possible to install | ||
38 | /bin/bash (sym)link and run scripts which start with | ||
39 | #!/bin/bash line. | ||
40 | |||
41 | Many systems use it in scripts which use bash-specific features, | ||
42 | even simple ones like $RANDOM. Without this option, busybox | ||
43 | can't be used for running them because it won't recongnize | ||
44 | "bash" as a supported applet name. | ||
45 | |||
46 | config FEATURE_BASH_IS_ASH | ||
47 | select ASH | ||
48 | bool "ash" | ||
49 | depends on !NOMMU | ||
50 | |||
51 | config FEATURE_BASH_IS_HUSH | ||
52 | select HUSH | ||
53 | bool "hush" | ||
54 | |||
55 | config FEATURE_BASH_IS_NONE | ||
56 | bool "none" | ||
57 | |||
58 | endchoice | ||
59 | 9 | ||
60 | config ASH | 10 | config ASH |
61 | bool "ash" | 11 | bool "ash" |
@@ -266,6 +216,61 @@ config HUSH_RANDOM_SUPPORT | |||
266 | Enable pseudorandom generator and dynamic variable "$RANDOM". | 216 | Enable pseudorandom generator and dynamic variable "$RANDOM". |
267 | Each read of "$RANDOM" will generate a new pseudorandom value. | 217 | Each read of "$RANDOM" will generate a new pseudorandom value. |
268 | 218 | ||
219 | |||
220 | choice | ||
221 | prompt "Choose which shell is aliased to 'sh' name" | ||
222 | default FEATURE_SH_IS_ASH | ||
223 | help | ||
224 | Choose which shell you want to be executed by 'sh' alias. | ||
225 | The ash shell is the most bash compatible and full featured one. | ||
226 | |||
227 | # note: cannot use "select ASH" here, it breaks "make allnoconfig" | ||
228 | config FEATURE_SH_IS_ASH | ||
229 | depends on ASH | ||
230 | bool "ash" | ||
231 | depends on !NOMMU | ||
232 | |||
233 | config FEATURE_SH_IS_HUSH | ||
234 | depends on HUSH | ||
235 | bool "hush" | ||
236 | |||
237 | config FEATURE_SH_IS_NONE | ||
238 | bool "none" | ||
239 | |||
240 | endchoice | ||
241 | |||
242 | choice | ||
243 | prompt "Choose which shell is aliased to 'bash' name" | ||
244 | default FEATURE_BASH_IS_NONE | ||
245 | help | ||
246 | Choose which shell you want to be executed by 'bash' alias. | ||
247 | The ash shell is the most bash compatible and full featured one. | ||
248 | |||
249 | Note that selecting this option does not switch on any bash | ||
250 | compatibility code. It merely makes it possible to install | ||
251 | /bin/bash (sym)link and run scripts which start with | ||
252 | #!/bin/bash line. | ||
253 | |||
254 | Many systems use it in scripts which use bash-specific features, | ||
255 | even simple ones like $RANDOM. Without this option, busybox | ||
256 | can't be used for running them because it won't recongnize | ||
257 | "bash" as a supported applet name. | ||
258 | |||
259 | config FEATURE_BASH_IS_ASH | ||
260 | depends on ASH | ||
261 | bool "ash" | ||
262 | depends on !NOMMU | ||
263 | |||
264 | config FEATURE_BASH_IS_HUSH | ||
265 | depends on HUSH | ||
266 | bool "hush" | ||
267 | |||
268 | config FEATURE_BASH_IS_NONE | ||
269 | bool "none" | ||
270 | |||
271 | endchoice | ||
272 | |||
273 | |||
269 | config LASH | 274 | config LASH |
270 | bool "lash (deprecated: aliased to hush)" | 275 | bool "lash (deprecated: aliased to hush)" |
271 | default n | 276 | default n |
diff --git a/shell/Kbuild.src b/shell/Kbuild.src index 8bdb68b11..d76b35386 100644 --- a/shell/Kbuild.src +++ b/shell/Kbuild.src | |||
@@ -5,6 +5,9 @@ | |||
5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. | 5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. |
6 | 6 | ||
7 | lib-y:= | 7 | lib-y:= |
8 | |||
9 | INSERT | ||
10 | |||
8 | lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o | 11 | lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o |
9 | lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o | 12 | lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o |
10 | lib-$(CONFIG_CTTYHACK) += cttyhack.o | 13 | lib-$(CONFIG_CTTYHACK) += cttyhack.o |
diff --git a/shell/hush.c b/shell/hush.c index 4cccf31a4..4832e2c48 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -7103,7 +7103,7 @@ int hush_main(int argc, char **argv) | |||
7103 | break; | 7103 | break; |
7104 | #if !BB_MMU | 7104 | #if !BB_MMU |
7105 | case '<': /* "big heredoc" support */ | 7105 | case '<': /* "big heredoc" support */ |
7106 | full_write(STDOUT_FILENO, optarg, strlen(optarg)); | 7106 | full_write1_str(optarg); |
7107 | _exit(0); | 7107 | _exit(0); |
7108 | case '$': { | 7108 | case '$': { |
7109 | unsigned long long empty_trap_mask; | 7109 | unsigned long long empty_trap_mask; |