diff options
-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); | |||
112 | static int busy_loop(FILE * input); | 112 | static int busy_loop(FILE * input); |
113 | 113 | ||
114 | 114 | ||
115 | /* Table of built-in functions */ | 115 | /* Table of built-in functions (these are non-forking builtins, meaning they |
116 | * can change global variables in the parent shell process but they will not | ||
117 | * work with pipes and redirects; 'unset foo | whatever' will not work) */ | ||
116 | static struct builtInCommand bltins[] = { | 118 | static struct builtInCommand bltins[] = { |
117 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, | 119 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, |
118 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, | 120 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, |
@@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { | |||
125 | {NULL, NULL, NULL, NULL} | 127 | {NULL, NULL, NULL, NULL} |
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* Table of built-in functions */ | 130 | /* Table of forking built-in functions (things that fork cannot change global |
131 | * variables in the parent process, such as the current working directory) */ | ||
129 | static struct builtInCommand bltins_forking[] = { | 132 | static struct builtInCommand bltins_forking[] = { |
130 | {"env", "Print all environment variables", "env", builtin_env}, | 133 | {"env", "Print all environment variables", "env", builtin_env}, |
131 | {"pwd", "Print current directory", "pwd", builtin_pwd}, | 134 | {"pwd", "Print current directory", "pwd", builtin_pwd}, |
@@ -112,7 +112,9 @@ static int runCommand(struct job newJob, struct jobSet *jobList, int inBg); | |||
112 | static int busy_loop(FILE * input); | 112 | static int busy_loop(FILE * input); |
113 | 113 | ||
114 | 114 | ||
115 | /* Table of built-in functions */ | 115 | /* Table of built-in functions (these are non-forking builtins, meaning they |
116 | * can change global variables in the parent shell process but they will not | ||
117 | * work with pipes and redirects; 'unset foo | whatever' will not work) */ | ||
116 | static struct builtInCommand bltins[] = { | 118 | static struct builtInCommand bltins[] = { |
117 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, | 119 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, |
118 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, | 120 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, |
@@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { | |||
125 | {NULL, NULL, NULL, NULL} | 127 | {NULL, NULL, NULL, NULL} |
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* Table of built-in functions */ | 130 | /* Table of forking built-in functions (things that fork cannot change global |
131 | * variables in the parent process, such as the current working directory) */ | ||
129 | static struct builtInCommand bltins_forking[] = { | 132 | static struct builtInCommand bltins_forking[] = { |
130 | {"env", "Print all environment variables", "env", builtin_env}, | 133 | {"env", "Print all environment variables", "env", builtin_env}, |
131 | {"pwd", "Print current directory", "pwd", builtin_pwd}, | 134 | {"pwd", "Print current directory", "pwd", builtin_pwd}, |
diff --git a/shell/lash.c b/shell/lash.c index 4620ae3ce..bb258c788 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -112,7 +112,9 @@ static int runCommand(struct job newJob, struct jobSet *jobList, int inBg); | |||
112 | static int busy_loop(FILE * input); | 112 | static int busy_loop(FILE * input); |
113 | 113 | ||
114 | 114 | ||
115 | /* Table of built-in functions */ | 115 | /* Table of built-in functions (these are non-forking builtins, meaning they |
116 | * can change global variables in the parent shell process but they will not | ||
117 | * work with pipes and redirects; 'unset foo | whatever' will not work) */ | ||
116 | static struct builtInCommand bltins[] = { | 118 | static struct builtInCommand bltins[] = { |
117 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, | 119 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, |
118 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, | 120 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, |
@@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { | |||
125 | {NULL, NULL, NULL, NULL} | 127 | {NULL, NULL, NULL, NULL} |
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* Table of built-in functions */ | 130 | /* Table of forking built-in functions (things that fork cannot change global |
131 | * variables in the parent process, such as the current working directory) */ | ||
129 | static struct builtInCommand bltins_forking[] = { | 132 | static struct builtInCommand bltins_forking[] = { |
130 | {"env", "Print all environment variables", "env", builtin_env}, | 133 | {"env", "Print all environment variables", "env", builtin_env}, |
131 | {"pwd", "Print current directory", "pwd", builtin_pwd}, | 134 | {"pwd", "Print current directory", "pwd", builtin_pwd}, |