A minimum shell developed for course CES-33 at ITA, SP, BR.
interactive
: Functions related to reading input and displaying informationinternal
: Define internal commands exit, jobs, fg and bg.parser
: Parser and Lexer used to parse a commandsystem
: Interfaces with the OS - system calls to execute and manage jobs.types
: Data structures program, job and stringarr.
- Output redirecting (>)
- Input redirecting (<)
- Pipelining (|)
- Running in background (&)
- Signal handling (Ctrl+C, Ctrl+Z)
Obs: Only the first member of a pipeline can redirect input. Only the last member can redirect output.
jobs
: Lists running jobsbg [n]
: Takes job n to background, defaults to 0fg [n]
: Brings job n to foreground, defaults to 0
A docker container with the necessary dependencies can be run with docker compose run main
. Docker server v20.10.14 was used during development.
Build with make debug
or make release
. Run with ./bin/minsh
.
/bin/ls | /usr/bin/sort -r | /usr/bin/tail -n 3 > outtest
/bin/sleep 5 &
Running the script ./test/test-1.sh
will run the minishell with a prepared input and compare the result generated to test-1.output.txt with the test-1.exepected.txt.
Empty script output means success (real output matches expected).