- Display a prompt and wait for the user to type a command. A command line always ends with a new line.
- The prompt is displayed again each time a command has been executed.
- The command lines are simple, no semicolons, no pipes, no redirections or any other advanced features.
- The command lines are made only of one word. No arguments will be passed to programs.
- If an executable cannot be found, print an error message and display the prompt again.
- Handle errors.
- You have to handle the “end of file” condition (Ctrl+D)
- Handle command lines with arguments
The shell will be compiled this following way:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 \*.c -o hsh
The shell should work like in interactive mode
$ ./hsh | /bin/ls | hsh main.c shell.c | ($) | exit
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
$
- MBOUME NAMEGNI Frank Patrick
- ZUNAÏD Ali