From c3a17f454a135dd1fc694ce8b203dda1233c341e Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Wed, 10 Aug 2022 06:42:17 -0400 Subject: [PATCH] have sh print prompt with write, not printf, to make system call lecture a little clearer. --- user/sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/sh.c b/user/sh.c index 36245b3..864405d 100644 --- a/user/sh.c +++ b/user/sh.c @@ -134,7 +134,7 @@ runcmd(struct cmd *cmd) int getcmd(char *buf, int nbuf) { - fprintf(2, "$ "); + write(1, "$ ", 2); memset(buf, 0, nbuf); gets(buf, nbuf); if(buf[0] == 0) // EOF