LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linux Bash Scripting Background (https://www.linuxquestions.org/questions/programming-9/linux-bash-scripting-background-618532/)

thunder44 02-04-2008 04:15 AM

Linux Bash Scripting Background
 
Hello,

I have to create some scripts using Linux Bash command.
How do you create 2 background processes, let the first background process execute the first command and then wait for the second background process to execute the second command and then the first background process should execute the third command?

druuna 02-04-2008 05:32 AM

Hi,

One option would be the use of 'tokens'.

background process one sets a 'token' (create an empty file. Name must be unique, but known by process two) once it has done its (1st) main thing.
background process two waits until token is set before executing main part.
background process two sets a 'token' (create an empty file. Name must be unique, but known by process one) once it has done its main thing.
background process one waits until token is set before executing 2nd main part.

But.......

Why use 3 scripts? Can't you create one script (the 2 background processes becoming functions).

Hope this helps.


All times are GMT -5. The time now is 10:25 AM.