: My working sources is available -- minus run.c and run.h -- in /home/solaris/ieng9/cs190e/public/v0.9.tar and here. You are not required to change your code to use this right now -- this is just what the parser team has done while you've been working on the execution module, and integration will happen sometime after this assignment is due -- in a subsequent assignment, when engineering change requests come in from the customers/marketing.
For testing purposes, you can run my working binary at /home/solaris/ieng9/cs190e/public/yaish.
old: A version of shvar.c with a couple of bug fixes is now available.
Note: you should confine your changes to run.c and run.h. The other files may change due to bug fixes -- and will almost certainly change for subsequent assignments based on newer versions of this source code. Are there problems with the following design?
You are to implement the following shell built-in commands:
|cd dir||changes the current working directory to be dir|
|pipe pname||creates a pipe to be later referred to by the name pname|
|pclose pname||closes both descriptors of the pipe pname|
|pclose pname mode||mode is r, w, or combination thereof; pclose closes the specified end of the descriptor(s) of the pipe pname. This is not a required part of the assignment.|
You are to also implement the execution of simple commands, using exec(2), fork(2), dup(2), dup2(2), pipe(2), etc as appropriate to handle command execution and I/O redirection. You may not use the system(3) library routine.
The shell syntax includes the following I/O redirection directives:
|num< fname||associate input descriptor num with file fname|
|num> fname||associate output descriptor num with file fname, truncating the file and creating it if necessary|
|num>> fname||associate output descriptor num with file fname, appending to the file and creating it if necessary|
|num<&num2||make input descriptor num refer to the same object as descriptor num2|
|num>&num2||make output descriptor num refer to the same object as descriptor num2|
|num<&-||close input descriptor num|
|num>&-||close output descriptor num|
|num<| pname||make input descriptor num read from the pipe pname|
|num>| pname||make output descriptor num write to the pipe pname|
email@example.com, last updated