This program written in C++ under Linux simulates the mechanism behind shells like bash, the default shell in several flavors of Linux.
Most commands are built without using the system() library.
Below is the list of some of the commands that can be used:
Some Examples of commands:
ls ==> see the content of the directory
pwd ==> find out the path of the current working directory
echo [TEXT] ==> display a text/string(s) on the standard output
exit [n] : terminates the shell with argument as exit value
exit : terminates the shell with 0 as exit value when no argument is provided
prompt [new_prompt]: changes the current shell prompt to the new_prompt
prompt : restores the shell to the default prompt when given no argument
cpuinfo [-switch]: for CPU related information
-c: the CPU clock
-t: the CPU type
-n: the number of cores
meminfo [-switch]: for memory related information
-t: total RAM available
-u: total RAM used
-c: L2 cache size
Display of the commands available
g++ driver.cpp cwushell.cpp
./a.out