aboutsummaryrefslogtreecommitdiff
path: root/sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'sh.c')
-rw-r--r--sh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sh.c b/sh.c
index e143cfe74..068159697 100644
--- a/sh.c
+++ b/sh.c
@@ -98,7 +98,7 @@ static int shell_fg_bg(struct job *cmd, struct jobSet *jobList);
98static int shell_help(struct job *cmd, struct jobSet *junk); 98static int shell_help(struct job *cmd, struct jobSet *junk);
99static int shell_jobs(struct job *dummy, struct jobSet *jobList); 99static int shell_jobs(struct job *dummy, struct jobSet *jobList);
100static int shell_pwd(struct job *dummy, struct jobSet *junk); 100static int shell_pwd(struct job *dummy, struct jobSet *junk);
101static int shell_set(struct job *cmd, struct jobSet *junk); 101static int shell_export(struct job *cmd, struct jobSet *junk);
102static int shell_source(struct job *cmd, struct jobSet *jobList); 102static int shell_source(struct job *cmd, struct jobSet *jobList);
103static int shell_unset(struct job *cmd, struct jobSet *junk); 103static int shell_unset(struct job *cmd, struct jobSet *junk);
104 104
@@ -120,7 +120,7 @@ static struct builtInCommand bltins[] = {
120 {"fg", "Bring job into the foreground", "fg [%%job]", shell_fg_bg}, 120 {"fg", "Bring job into the foreground", "fg [%%job]", shell_fg_bg},
121 {"jobs", "Lists the active jobs", "jobs", shell_jobs}, 121 {"jobs", "Lists the active jobs", "jobs", shell_jobs},
122 {"pwd", "Print current directory", "pwd", shell_pwd}, 122 {"pwd", "Print current directory", "pwd", shell_pwd},
123 {"set", "Set environment variable", "set [VAR=value]", shell_set}, 123 {"export", "Set environment variable", "export [VAR=value]", shell_export},
124 {"unset", "Unset environment variable", "unset VAR", shell_unset}, 124 {"unset", "Unset environment variable", "unset VAR", shell_unset},
125 125
126 {".", "Source-in and run commands in a file", ". filename", 126 {".", "Source-in and run commands in a file", ". filename",
@@ -182,7 +182,7 @@ static int shell_exit(struct job *cmd, struct jobSet *junk)
182static int shell_fg_bg(struct job *cmd, struct jobSet *jobList) 182static int shell_fg_bg(struct job *cmd, struct jobSet *jobList)
183{ 183{
184 int i, jobNum; 184 int i, jobNum;
185 struct job *job; 185 struct job *job=NULL;
186 186
187 if (!jobList->head) { 187 if (!jobList->head) {
188 if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { 188 if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
@@ -268,8 +268,8 @@ static int shell_pwd(struct job *dummy, struct jobSet *junk)
268 return TRUE; 268 return TRUE;
269} 269}
270 270
271/* built-in 'set VAR=value' handler */ 271/* built-in 'export VAR=value' handler */
272static int shell_set(struct job *cmd, struct jobSet *junk) 272static int shell_export(struct job *cmd, struct jobSet *junk)
273{ 273{
274 int res; 274 int res;
275 275
@@ -278,7 +278,7 @@ static int shell_set(struct job *cmd, struct jobSet *junk)
278 } 278 }
279 res = putenv(cmd->progs[0].argv[1]); 279 res = putenv(cmd->progs[0].argv[1]);
280 if (res) 280 if (res)
281 fprintf(stdout, "set: %s\n", strerror(errno)); 281 fprintf(stdout, "export: %s\n", strerror(errno));
282 return (res); 282 return (res);
283} 283}
284 284