diff options
author | Mark Whitley | 2000-07-12 23:36:17 +0000 |
---|---|---|
committer | Mark Whitley | 2000-07-12 23:36:17 +0000 |
commit | 37653aaf9c6ca3f21165e247ad385fb81d1b0112 (patch) | |
tree | 1a30b45c91726efbf5884accdba2caf01438c99d | |
parent | c41e8c840fd6faf802628036c7e5b2683d623c5d (diff) | |
download | busybox-37653aaf9c6ca3f21165e247ad385fb81d1b0112.zip busybox-37653aaf9c6ca3f21165e247ad385fb81d1b0112.tar.gz |
Added some smallish comments to help folks understand why we have two tables
of builtins and the reasoning behind it.
-rw-r--r-- | lash.c | 7 | ||||
-rw-r--r-- | sh.c | 7 | ||||
-rw-r--r-- | shell/lash.c | 7 |
3 files changed, 15 insertions, 6 deletions
@@ -112,7 +112,9 @@ static int runCommand(struct job newJob, struct jobSet *jobList, int inBg); static int busy_loop(FILE * input); -/* Table of built-in functions */ +/* Table of built-in functions (these are non-forking builtins, meaning they + * can change global variables in the parent shell process but they will not + * work with pipes and redirects; 'unset foo | whatever' will not work) */ static struct builtInCommand bltins[] = { {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, {"cd", "Change working directory", "cd [dir]", builtin_cd}, @@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { {NULL, NULL, NULL, NULL} }; -/* Table of built-in functions */ +/* Table of forking built-in functions (things that fork cannot change global + * variables in the parent process, such as the current working directory) */ static struct builtInCommand bltins_forking[] = { {"env", "Print all environment variables", "env", builtin_env}, {"pwd", "Print current directory", "pwd", builtin_pwd}, @@ -112,7 +112,9 @@ static int runCommand(struct job newJob, struct jobSet *jobList, int inBg); static int busy_loop(FILE * input); -/* Table of built-in functions */ +/* Table of built-in functions (these are non-forking builtins, meaning they + * can change global variables in the parent shell process but they will not + * work with pipes and redirects; 'unset foo | whatever' will not work) */ static struct builtInCommand bltins[] = { {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, {"cd", "Change working directory", "cd [dir]", builtin_cd}, @@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { {NULL, NULL, NULL, NULL} }; -/* Table of built-in functions */ +/* Table of forking built-in functions (things that fork cannot change global + * variables in the parent process, such as the current working directory) */ static struct builtInCommand bltins_forking[] = { {"env", "Print all environment variables", "env", builtin_env}, {"pwd", "Print current directory", "pwd", builtin_pwd}, diff --git a/shell/lash.c b/shell/lash.c index 4620ae3..bb258c7 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -112,7 +112,9 @@ static int runCommand(struct job newJob, struct jobSet *jobList, int inBg); static int busy_loop(FILE * input); -/* Table of built-in functions */ +/* Table of built-in functions (these are non-forking builtins, meaning they + * can change global variables in the parent shell process but they will not + * work with pipes and redirects; 'unset foo | whatever' will not work) */ static struct builtInCommand bltins[] = { {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, {"cd", "Change working directory", "cd [dir]", builtin_cd}, @@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { {NULL, NULL, NULL, NULL} }; -/* Table of built-in functions */ +/* Table of forking built-in functions (things that fork cannot change global + * variables in the parent process, such as the current working directory) */ static struct builtInCommand bltins_forking[] = { {"env", "Print all environment variables", "env", builtin_env}, {"pwd", "Print current directory", "pwd", builtin_pwd}, |