Im working on shell like software under Linux,
In my shell the main process print ">>" than the user enter the command.
The main process forking new process that will execute the command
And than new ">>" will be printed
To run the wanted command im using execl (I have to use this specific command)

The problem is in the printing of the next ">>", because im using different processes I cant control the time of the next ">>" prin

For ls command


Same command again (like i wish that will be printed evry time)

(for the record, after execl command the process is terminated, no command will run after the execl)

Edited by stewie griffin: n/a

8 Years
Discussion Span
Last Post by nezachem

Do you call wait() in the parent process?

no, how can I make shore that the father (main process) will start again exactly after the son (the new process that will run the command) And will not wait to long or to short (if the user run a command that required long cpu time)?

Edited by stewie griffin: n/a


Is the wait() will make the father wait until his son is killed or will wait for a random time?


There is a nice utility called 'man'. Type 'man wait' at a command prompt and read the documentation.

And yes, wait is the only way to inform parent that child terminated. Besides, omitting wait() will lead to some nasty surprises.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.