Hello, i've been tasked to create a linux shell using C. every command should run as if it was ran by a standard terminal except the commands "exit" (which was easily implemented) and "history". in history i should print all commands that have been written to the shell (wether they were successful or not) with the PID of the thread that received it:
$ history
123 cd asd
456 ls
123 ls -l
456 cd asdflajfd
456 history
$
assume the shell will receive max 100 commands, each in 100 chars length max.
My question is:
how do I create an "history array" that is shared with all threads and their "sons", in a way that will achieve the task mentioned above?