DamoSWL / 8000_Shell

project 1 written in C/C++ in 8000
Apache License 2.0
0 stars 0 forks source link

Project

Write a Shell in C/C++.

Objective:

It’s easy to view yourself as “not a real programmer.” There are programs out there that everyone uses, and it’s easy to put their developers on a pedestal. Although developing large software projects isn’t easy, many times the basic idea of that software is quite simple. Implementing it yourself is a fun way to show that you have what it takes to be a real programmer.

Description:

A shell does three main things in its lifetime.
(1) Initialize
(2) Interpret
(3) Terminate

The shell should support pipe (|), service (&), and file redirection (<, >, >>). The following commands (with their traditional objective)should be implemented:
cd:

cd [directory]

‘~’, .., ‘/’ are valid (along with alphanumeric characters) and stand for traditional meaning.
pwd:

pwd [OPTION]

ls:

ls [OPTION]... [FILE]...

Option: -l, -r, -s, --file-type (match file extension).
Exit:

exit

Quite the shell (Terminate).

Find:

find path -name filename

for example,

find . -name a.txt
find . -name *.txt

File Redirection(>,>>,<):

ls -l > a.txt
ls -l >> a.txt
ls -l < b.txt (in b.txt we have filename, for example ./shell)
find . -name b.txt > a.txt

Service(&):

find . -name a.txt &

History:

history

Pipeline

ls | pwd

Interrupt(Ctrl+C)

Programming Language used

C++

Contributors

Weili, Shi
Sixiang, Zhang

How to run

run the following command.

./shell

License

License