||1 year ago|
|.gitignore||5 years ago|
|Makefile||1 year ago|
|README.md||5 years ago|
|bish.cc||5 years ago|
|parse.cc||5 years ago|
|parse.h||5 years ago|
|util_fns.cc||5 years ago|
|util_fns.h||5 years ago|
If you use more than 3 lines of code from the internet, cite them in a comment. It's cause for an 'f' otherwise!!!!
THIS IS OUT OF 20 POINTS!!!! No one can get more than 20 points.
If you work in pairs, then I'll give each person 2/3 of the total points. So if a team gets 30 (and each person gets 15), I'll give each student 20.
If you work in threes, then I'll give each person 1/2 of the total points. So if a team gets 40 (and each person gets 13.3333), I'll give each student 20.
The Shell Assignment (total 42 points)
Can run an executable
You search the path for the executable
Can do file input redirection "<"
ls > fred
Can do file output redirection ">"
ls < fred
Can do command piping "|"
ls | wc
Can do lots of pipes
ls | grep fred | wc
Can do at least one combination of these things
ls | wc > fred
Can do any combination of three of <, >, and |
cat < filename | sort > sortedFile.txt
- 2 Can set enviornment variables
Expands enviornment variables on the command line
Does filename expansion "glob" (Hint: Use the built in glob.)
Knows how to change directory
- 1 Bang last command
- 1 Bang # command
!4runs 4th command from history
make ; make install
Can have lots of semicolons
ls; sleep 3; rm fred
- 2 Change Prompt
PS1="what is you command?"
- 3 Can run commands in the background.
- 1 Concatenate commands with &. Only runs next command if the previous
comand returned success.
cd /home/rappleto & rm fred.txt
Catch Keyboard interrupt
ctrl + c= back to prompt
Replace "~" with the home directory
Control-L clears the screen
ctrl-l= clear screen
- 3 When they misspell a command, offer a suggestion
- (shell) Did you mean
- 2 Can run commands from a file
Tab Completionand Arrow History
Saves and reloads history to a file
- 2 Automatically runs a file called .myshell when it starts
- 2 Only runs execuatables from an approved list
- -2 Commands cannot have arguments (i.e. ls -l does not work).
25 pts /20
Some cases to consider
- A person tries to run a non-executable.
- A person tries to read or write to a non-existent file.
- A person tries to read or write to a file they do not have permissions on.
- A person tries a non-sensical command. (i.e.
ls > foo > fee < doo < dee)
- A person tries to pipe to a non-command (i.e.
ls | /tmp/foo.txt)
- A person tries to pipe from a non-command (i.e.
/tmp/foo | ls)
- A person tries to expand a non-variable (i.e.
- A regular expression matches no files.
- A regular expression matches one file.
- A regular expression matches lots of files.
- A person tries to change directory to something that does not exist.
These programs are due Friday before finals week. It will take a totally excellent excuse to move this at all.