@@ -2,6 +2,17 @@ Additional notes on the lab assignment based on existing implementations.
22
33Last updated: Dec 31, 2018.
44
5+ --------------------------------------------------------------------------------
6+ We really require you to use a consistent C style.
7+
8+ For example, the following two lines do not use consistent C style as one line
9+ uses extra spaces with parentheses and the other does not, and also there is a
10+ differentce with whitespace around '{':
11+
12+ if (WIFEXITED( wstatus )){
13+
14+ if (pipe(pd) == -1) {
15+
516--------------------------------------------------------------------------------
617Refuse special characters that you do not implement yet. For example, if you do
718not implement pipes (as in the 1st phase), refuse it. It cannot work like this:
@@ -17,11 +28,24 @@ If you did accept '|' as a normal character, it should have worked like this:
1728$ echo hello | wc -l
1829hello | wc -l
1930
20- However, please do something like this:
31+ And in case of date(1), it should have printed out an error, similar to this:
32+
33+ $ date xxx
34+ date: illegal time format
35+ usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
36+ [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
37+
38+ So, do something like the following:
2139
2240$ echo hello | wc -l
2341(default rule matched) error:1: syntax error near unexpected token '|'
2442
43+ Also, refure redirections unless you already implemented those. The following
44+ is not correct in the 1st phase:
45+
46+ $ echo hello > out
47+ hello
48+
2549--------------------------------------------------------------------------------
2650Please do implement command line history. In case of readline, it's really just
2751calling one function, like this, for example:
0 commit comments