Hah! As if anything about this project is "simple."
Four steps:
- Give your shell a clever name.
- Open the file
configand update the variableSHELLwith the name of your shell (ex: "./hsh"). - Move the executable for your shell into your local copy of this repository.
- Does your shell have a clever name? No? Go back and repeat steps 1-3.
Usage ./check_simple_shell.bash
After execution, the above script will run your shell executable on every test file in the repository. Successful tests will result in a green happy face, while failures will result in a red sad face (or an error).
More than four steps:
- In a given directory, make a new copy of an existing file.
- Make sure to give your copy a new name.
- Open the new file with your favorite text editor (coughMS-DOS Editorcoughcough)
- You play a dangerous game playing favorites on Open Source
- You play a dangerous game using MS-DOS Editor!
- Make the following edits to the new file:
- At the top, change the variable
commandto the new command you'd like to test. - Make necessary changes to the
# check the resultand/or# send commandssections. This is where it gets a little tricky, but let me try to help you out:- Think about the best way to compare output with the
/bin/shshell. Most often you will want to use eithergrepordiff. - Trying to compare output character for character? Pipe the command into two separate files and
diffthe result. See 01_simple_shell_0.1/bin_hostname for reference. - Trying to test a command where output might not match character for character 100%? Use
grepto match a smaller commanility between the two. See 01_simple_shell_0.1/bin_ls for reference. - Still not sure what to do? Ask for help!
- Think about the best way to compare output with the
- Update the documentation with a brief description of your new test.
- At the top, change the variable
- Add your name to the
AUTHORSfile!
Note that scripts involving more complicated commands may require more changes than described above. If you need help writing a new test script, reach out for help!
- Valgrind vAlgrind valgrinD vaLgrind valGrind
- Always test everything in both interactive and non-interactive mode
- When in doubt, compare results or output to
/bin/sh - valgRind vaLgrind valgriNd Valgrind vAlgrind
- Check return values - compare with
/bin/sh - Valgrind some more, just for kicks
This project is licensed under the MIT License - see the LICENSE.md file for details
