The simple shell project is a collaboration between Oscar De León and Juan Camilo Villa, Software Engineering students at Holberton School, with which we can emulate the operation of a shell, which contains some of its most basic characteristics, such as : Handle PATH, Handle command lines with arguments.
Holberton School Shell (hsh), is a simple program of the line commands. This simple shell recreates basic and some more complex functionalities to result in our own Shell. This shell si developed in the programming language c. This shell takes the keyboard commands and delivers them to the system to be executed. some built-in commands implement: exit, env, help, cd.
Simple_shell is designed to run in the Ubuntu 14.04 LTS linux environment and to be compiled using the GNU compiler collection v. gcc 4.8.4 with flags -Wall, -Werror, -Wextra, and -pedantic.
Do you need clone this repository:
git clone https://github.com/jcamilovillah/simple_shell
and then you can compile with this command:
gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
after compilation you can excecute with this command:
./hsh
- Compile the program to create the
hshexecutable file (see instructions above). - run the executable as follows
./hsh - Enter basic commands like:
ls, you can add flags along withlscommand such as-l,-la(ls -l,ls -la) - press enter after entering the command
- to end the execution of the
simple_shellprogram pressctrl + dor write the wordexit
Your shell should work like this in interactive mode:
$ ./hsh
($) /bin/ls
hsh main.c shell.c
($)
($) exit
$
But also in non-interactive mode:
$ echo "/bin/ls" | ./hsh
hsh main.c shell.c test_ls_2
$
$ cat test_ls_2
/bin/ls
/bin/ls
$
$ cat test_ls_2 | ./hsh
hsh main.c shell.c test_ls_2
hsh main.c shell.c test_ls_2
$