Bob's finally coming out of his shell.
bsh __
___ | "---.
." ". -o) | |
<|_______|/` |__,---;
UU UU ====|_______|
Welcome to Bob shell.See CONTRIBUTING.md for more info on running the test suite, contributing to the project, and improving the documentation.
macOS and Ubuntu are currently supported and tested. This project requires CMake version 2.8 or higher to build.
macOS:
brew install cmakeUbuntu:
sudo apt-get install cmake libbsd-dev libreadline-dev pkg-configAfter these dependencies are installed:
git clone https://github.com/rgardner/bsh
cd bsh
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -GNinja ..
# Build
cmake --build .
# Run
cmake --build . --target runDoxygen is required to build documentation:
macOS:
brew install doxygenUbuntu:
sudo apt-get install doxygenTo generate the documentation:
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -GNinja ..
cmake --build . --target doc
# open doc/html/index.htmlCMake is the build system used for this project. Originally, this started as
a simple Makefile, but it grew more complicated until eventually cmake became
the more viable option.
libbsd-dev is required on Ubuntu to get access to strlcpy and strlcat,
two functions that make working with strings much easier. This
paper does a good job of
explaining the design intentions of these functions.
libreadline-dev is required on Ubuntu to embed readline in an
application. readline is only used to grab text from the user; its history
capabilities are not used and are instead re-implemented as a learning
exercise.
pkg-config is required on Ubuntu to help install libbsd. It makes it
easier to port this project to other systems because it helps us avoid
hard-coding dependencies.
doxygen is a tool to generate documentation. Source comments are annotated
using a JavaDoc-like style, which doxygen uses to create HTML and PDFs.
check is the unit-testing framework chosen for this project. It is one of
the most popular C unit-testing frameworks and works well with cmake.
write the parserbasic shell supportExtra history featureshistory -s numandhistory num
whichdirs, pushd, popdaliaspipeadvanced I/Ofg/bgprintenv/setenv- shell scripting:
if/then,while,for - tab completion and command prompt editing
- up and down arrows to scroll through history list
- relax constrains (allow
prog>outfile) - terminal support
- port to Windows
These resources have been invaluable to me while working on this project:
- Cornell CS414 Summer 2004 by Jeanna Matthews
- GNU History Library
- Bash source code
- Implementing a Job Control Shell
- The C Programming Language, 2nd Edition
The awesome "geek tortoise" ascii art was found on Retrojunkie.