To implement a very primitive shell (a Toy Shell) that
knows how to launch new programs in the foreground and the background.
It should also recognize a few internal commands. More specifically,
it should support the following features.

It should recognize two internal commands: exit and cd. exit should
use the exit() system call to terminate the shell. cd uses the chdir()
system call to change to a new directory.

If the command line does not indicate any internal commands, it should
be in the following form:
<program name> <arg1> <arg2> .... <argN> [&]
the shell should invoke the program, passing it the list of arguments
in the command line. The shell must wait until the started program
complete unless the user runs it at the background (with &).

Hey there,

Sounds like you just want to write an interactive looping shell script that would overlay a full feature shell. Check out the bash scripting tutorial - I think it's a sticky post at the top of this section - and you should find how to do everything you need.

Best wishes,