Well, I don't think sample code is really going to help that much. However, you can download the source to most (if not all) of the popular shells through
freshmeat.
Here are links to some of the most popular shells' pages on freshmeat:
bash
tcsh
ksh (public domain version)
The reason I say they may not be that useful is because these are full-on projects. There is a lot of code to implement features that may not apply to the goals of your project. Depending on the level of this project (high school, undergraduate, or graduate), those features may serve to unnecessarily complicate the extraction of code examples; you have to filter out what's important and what's not. Figuring out what's important is a huge task on its own.
If this is a first-year or other basic programming course assignment, then looking for sample code in the above projects is likely a mistake. Just focus on implementing a basic loop:[list=1][*]Prompt the user for input[*]Parse the command[*]Execute the operation[*]Display results (if necessary)[*]Loop back to #1[/list=1]
Shells are not fundamentally complex programs. The features (tab completion, environment variables, etc.) are where the complexity comes in.
EDIT:
Doh! cs-cam beat me to the punch with the bash link... I type too slowly...