This project implements a Unix-like shell (yshell) that operates on an in-memory file system. It supports basic file and directory operations, mimicking a subset of standard shell commands.
- In-memory file system: No files are written to disk.
- Supported commands:
cat,cd,echo,exit,ls,lsr,make,mkdir,prompt,pwd,rm,rmr
- Path navigation and manipulation
- Error handling for invalid commands and operations
- Customizable shell prompt
From the src/ directory, run:
makeThis will build the yshell executable.
Run the shell:
./yshellYou can then enter commands similar to a Unix shell. For example:
mkdir foo
cd foo
make file1 some content
ls
cat file1
pwd
rm file1
cd /
rmdir foo
exitTest scripts are located in the test/ directory. To run all tests:
cd test
bash mk.testsThis will execute all .ysh test scripts using the built yshell and compare outputs.
make file this is the first file
make second file
make third file with more stuff in it
cat file
cat second
cat file second third
ls /
- C++20 compiler (e.g.,
g++) - Standard Unix build tools (
make) - Optional:
valgrindfor memory checking
src/: Source code and Makefiletest/: Test scripts and test outputs