Some suggested additional features to implement in your shell:

WARNING: These or any other additional features you choose to implement do NOT take the place of implementing one of the two required challenge problems. They may give you additional extra credit, depending on difficulty and how well it works. Please do NOT ask us how much extra credit feature X will receive. The goal here is to learn and expand on your abilities. A few additional points are more a side effect. In general, the maximum extra credit will be < 25% of the total grade.

Also, please do NOT ask what the semantics of a particular additional feature should be. Use bash as an example. Do some investigation, experiment, read man pages, etc. to find out what bash does. Then be sure you explain in your README what additional features you've implemented and what their semantics are. If you choose to differ from bash, explain why.

Tab completion

Start to type in a filename in many standard shells (e.g. Bash) and see what happens! It automatically matches a filename based on what you have typed so far. Try to mimic this style of filename matching in your shell when the tab key is pressed. Note this will likely require altering how you input strings from the user. In particular, you need to read characters as they occur, and could not use fgets(..)

Command history

Many shells allow you to press the up and down arrows to repeat previously executed commands. Some even use an external .history file that stores commands from your previous session.

Environment variables

Shells typically allow you to set environment variables. For example, $HOME or ~ is often a shortcut to mean your home directory. I can say either "$cd ~" or "$cd /Users/mike" to change to my home directory. Environment variables are often used by executables for finding other binaries or libraries (e.g. JAVA_HOME='/Library/Java/Home') on my Mac.

To see the value of a specific environment variable, type "$echo $VARIABLE". To see all of the environment variables set, type "$env". To set an environment variable, type "$export VARIABLE="value"" in bash. In an sh shell (e.g. csh), use "$setenv VARIABLE value". Try implementing environment variables in your shell.

Additional redirection capabilities

You are only required to support basic input, output, and error redirection with the '<', '>', and '2>' symbols. There are several other options you can use for redirection, including:

'>> filename': appends the output to an already existing file 'filename'. '>' output redirection overwrites an existing file.
'i>&j': redirects the output of file descriptor i to file descriptor j.
'>& filename': redirects stdout and stderr to 'filename'

There are many other possibilities. Check out http://linuxreviews.org/beginner/abs-guide/en/c12264.html for a more complete list.

updated 4/26/05