diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 85 | ||||
-rw-r--r-- | shell/hush.c | 68 |
2 files changed, 51 insertions, 102 deletions
diff --git a/shell/ash.c b/shell/ash.c index 9c46a93e0..20ed9652c 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -35,8 +35,6 @@ //config: bool "Optimize for size instead of speed" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Compile ash for reduced size at the price of speed. //config: //config:config ASH_INTERNAL_GLOB //config: bool "Use internal glob() implementation" @@ -46,6 +44,23 @@ //config: Do not use glob() function from libc, use internal implementation. //config: Use this if you are getting "glob.h: No such file or directory" //config: or similar build errors. +//config: Note that as of now (2017-01), uclibc and musl glob() both have bugs +//config: which would break ash if you select N here. +//config: +//config:config ASH_BASH_COMPAT +//config: bool "bash-compatible extensions" +//config: default y +//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH +//config: +//config:config ASH_JOB_CONTROL +//config: bool "Job control" +//config: default y +//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH +//config: +//config:config ASH_ALIAS +//config: bool "Alias support" +//config: default y +//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: //config:config ASH_RANDOM_SUPPORT //config: bool "Pseudorandom generator and $RANDOM variable" @@ -63,88 +78,60 @@ //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: help -//config: "PS#" may contain volatile content, such as backquote commands. +//config: $PS# may contain volatile content, such as backquote commands. //config: This option recreates the prompt string from the environment //config: variable each time it is displayed. //config: -//config:config ASH_BASH_COMPAT -//config: bool "bash-compatible extensions" -//config: default y -//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable bash-compatible extensions. -//config: //config:config ASH_IDLE_TIMEOUT -//config: bool "Idle timeout variable" -//config: default n -//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enables bash-like auto-logout after $TMOUT seconds of idle time. -//config: -//config:config ASH_JOB_CONTROL -//config: bool "Job control" -//config: default y -//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable job control in the ash shell. -//config: -//config:config ASH_ALIAS -//config: bool "Alias support" +//config: bool "Idle timeout variable $TMOUT" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: help -//config: Enable alias support in the ash shell. +//config: Enable bash-like auto-logout after $TMOUT seconds of idle time. //config: -//config:config ASH_GETOPTS -//config: bool "Builtin getopt to parse positional parameters" +//config:config ASH_MAIL +//config: bool "Check for new mail in interactive shell" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: help -//config: Enable support for getopts builtin in ash. +//config: Enable "check for new mail" function: +//config: if set, $MAIL file and $MAILPATH list of files +//config: are checked for mtime changes, and "you have mail" +//config: message is printed if change is detected. //config: //config:config ASH_BUILTIN_ECHO -//config: bool "Builtin version of 'echo'" +//config: bool "echo builtin" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable support for echo builtin in ash. //config: //config:config ASH_BUILTIN_PRINTF -//config: bool "Builtin version of 'printf'" +//config: bool "printf builtin" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable support for printf builtin in ash. //config: //config:config ASH_BUILTIN_TEST -//config: bool "Builtin version of 'test'" +//config: bool "test builtin" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable support for test builtin in ash. //config: //config:config ASH_HELP //config: bool "help builtin" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable help builtin in ash. //config: -//config:config ASH_CMDCMD -//config: bool "'command' command to override shell builtins" +//config:config ASH_GETOPTS +//config: bool "getopts builtin" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH -//config: help -//config: Enable support for the ash 'command' builtin, which allows -//config: you to run the specified command with the specified arguments, -//config: even when there is an ash builtin command with the same name. //config: -//config:config ASH_MAIL -//config: bool "Check for new mail on interactive shells" +//config:config ASH_CMDCMD +//config: bool "command builtin" //config: default y //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: help -//config: Enable "check for new mail" function in the ash shell. +//config: Enable support for the 'command' builtin, which allows +//config: you to run the specified command or builtin, +//config: even when there is a function with the same name. //config: //config:endif # ash options diff --git a/shell/hush.c b/shell/hush.c index 22d71cb07..9e508fc6d 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -99,8 +99,6 @@ //config: bool "bash-compatible extensions" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable bash-compatible extensions. //config: //config:config HUSH_BRACE_EXPANSION //config: bool "Brace expansion" @@ -123,8 +121,6 @@ //config: bool "Save command history to .hush_history" //config: default y //config: depends on HUSH_INTERACTIVE && FEATURE_EDITING_SAVEHISTORY -//config: help -//config: Enable history saving in hush. //config: //config:config HUSH_JOB //config: bool "Job control" @@ -138,39 +134,35 @@ //config: but no separate process group is formed. //config: //config:config HUSH_TICK -//config: bool "Process substitution" +//config: bool "Support process substitution" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: help -//config: Enable process substitution `command` and $(command) in hush. +//config: Enable `command` and $(command). //config: //config:config HUSH_IF //config: bool "Support if/then/elif/else/fi" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable if/then/elif/else/fi in hush. //config: //config:config HUSH_LOOPS //config: bool "Support for, while and until loops" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable for, while and until loops in hush. //config: //config:config HUSH_CASE //config: bool "Support case ... esac statement" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: help -//config: Enable case ... esac statement in hush. +400 bytes. +//config: Enable case ... esac statement. +400 bytes. //config: //config:config HUSH_FUNCTIONS //config: bool "Support funcname() { commands; } syntax" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: help -//config: Enable support for shell functions in hush. +800 bytes. +//config: Enable support for shell functions. +800 bytes. //config: //config:config HUSH_LOCAL //config: bool "local builtin" @@ -199,22 +191,21 @@ //config: bool "echo builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable echo builtin in hush. //config: //config:config HUSH_PRINTF //config: bool "printf builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable printf builtin in hush. +//config: +//config:config HUSH_HELP +//config: bool "help builtin" +//config: default y +//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: //config:config HUSH_EXPORT //config: bool "export builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable export builtin in hush. //config: //config:config HUSH_EXPORT_N //config: bool "Support 'export -n' option" @@ -223,82 +214,55 @@ //config: help //config: export -n unexports variables. It is a bash extension. //config: -//config:config HUSH_HELP -//config: bool "help builtin" -//config: default y -//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable help builtin in hush. Code size + ~1 kbyte. -//config: //config:config HUSH_KILL -//config: bool "kill builtin (for kill %jobspec)" +//config: bool "kill builtin (supports kill %jobspec)" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable kill builtin in hush. //config: //config:config HUSH_WAIT //config: bool "wait builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable wait builtin in hush. //config: //config:config HUSH_TRAP //config: bool "trap builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable trap builtin in hush. -//config: -//config:config HUSH_ULIMIT -//config: bool "ulimit builtin" -//config: default y -//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable ulimit builtin in hush. //config: //config:config HUSH_TYPE //config: bool "type builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable type builtin in hush. //config: //config:config HUSH_READ //config: bool "read builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable read builtin in hush. //config: //config:config HUSH_SET //config: bool "set builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable set builtin in hush. //config: //config:config HUSH_UNSET //config: bool "unset builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable unset builtin in hush. +//config: +//config:config HUSH_ULIMIT +//config: bool "ulimit builtin" +//config: default y +//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: //config:config HUSH_UMASK //config: bool "umask builtin" //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable umask builtin in hush. //config: //config:config HUSH_MEMLEAK //config: bool "memleak builtin (debugging)" //config: default n //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH -//config: help -//config: Enable memleak builtin in hush. //config: //config:config MSH //config: bool "msh (deprecated: aliased to hush)" @@ -1096,8 +1060,6 @@ static const struct built_in_command bltins1[] = { BLTIN("wait" , builtin_wait , "Wait for process"), #endif }; -/* For now, echo and test are unconditionally enabled. - * Maybe make it configurable? */ static const struct built_in_command bltins2[] = { BLTIN("[" , builtin_test , NULL), #if ENABLE_HUSH_ECHO |