Explore the importance of a shell in a OS and learn how to create a simple shell using system call in C.
Using Ubuntu 24.04 LTS to compile the program using gcc, with the option -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh.
Your shell should work like this in interactive mode:
user@ubuntu:/# ./hsh
($) /bin/ls
hsh main.c shell.c
($)
($) exit
user@ubuntu:/#But also in non-interactive mode:
user@ubuntu:/# echo "/bin/ls" | ./hsh
hsh main.c shell.c test_ls_2
user@ubuntu:/# cat test_ls_2
/bin/ls
/bin/ls
user@ubuntu:/# cat test_ls_2 | ./hsh
hsh main.c shell.c test_ls_2
hsh main.c shell.c test_ls_2
user@ubuntu:/#