Fork two processes and kill the second when the first is done
- by User1
The title says it all. I want to create a bash script that will launch two processes and kill the second process when the first is done. Here's an example:
#fork first process
producer&
#fork second process
consumer&
#wait for producer to finish
...
#kill the consumer
...
I have a feeling this can get ugly but has a very simple solution. Please help me fill in the blanks.