I am writing a shell script in which i need to call a binary three times and i need to transfer the call to main program once all these three binaries have completed. I think I need to use fork and wait in my shell script. I am not sure how to implement fork, wait and exec in shell script. I would like to know some good tutorial where I can read these in good detail.
Thanks you so much for help in advance.
If you are using bash (or ksh, or others) as your shell, then this is how you “fork” and wait:
Using an
&after a command makes it execute in the background; elsewise the shell will wait after each command.waitwith no args waits for all jobs, i.e. children.$ help wait jobsand the man page for bash can give you more insight into job management.