LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-04-2008, 04:15 AM   #1
thunder44
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
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?
 
Old 02-04-2008, 05:32 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux > #bash Scripting Help Tommis Linux - General 10 09-16-2007 06:02 PM
How To Make Installer In Linux Bash Scripting pak_abdul Programming 1 05-24-2005 08:37 AM
Linux Shell Scripting using BASH Help! fooforon Programming 5 02-05-2004 09:16 AM


All times are GMT -5. The time now is 04:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration