summaryrefslogtreecommitdiff
path: root/user/sh.c
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2024-01-17 11:33:39 +0800
committerMole Shang <[email protected]>2024-01-18 14:25:09 +0800
commit33ca12a4653752d179e6296c7ca2f91a626d30f3 (patch)
tree819af498462a8a0f725c408c08aa0dae53f6f07b /user/sh.c
parente6ef31e4b30af1f30a4d1385971df602a8446cac (diff)
downloadxv6-labs-33ca12a4653752d179e6296c7ca2f91a626d30f3.tar.gz
xv6-labs-33ca12a4653752d179e6296c7ca2f91a626d30f3.tar.bz2
xv6-labs-33ca12a4653752d179e6296c7ca2f91a626d30f3.zip
lab util: finish
Diffstat (limited to 'user/sh.c')
-rw-r--r--user/sh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/user/sh.c b/user/sh.c
index 836ebcb..5eceda0 100644
--- a/user/sh.c
+++ b/user/sh.c
@@ -165,6 +165,9 @@ main(void)
fprintf(2, "cannot cd %s\n", buf+3);
continue;
}
+ if(buf[0] == 'e' && buf[1] == 'x' && buf[2] == 'i' && buf[3] == 't'){
+ exit(0);
+ }
if(fork1() == 0)
runcmd(parsecmd(buf));
wait(0);